Split client and server.
This commit is contained in:
parent
3cb62b0291
commit
c3622cb263
208 changed files with 194 additions and 219 deletions
|
@ -1,267 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn;
|
||||
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
|
||||
import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.BlockEntityRendererRegistry;
|
||||
import net.fabricmc.fabric.api.renderer.v1.RendererAccess;
|
||||
import net.minecraft.client.item.ModelPredicateProviderRegistry;
|
||||
import net.minecraft.client.item.UnclampedModelPredicateProvider;
|
||||
import net.minecraft.client.render.RenderLayer;
|
||||
import net.minecraft.client.render.model.BakedModel;
|
||||
import net.minecraft.client.render.model.ModelBakeSettings;
|
||||
import net.minecraft.client.render.model.ModelLoader;
|
||||
import net.minecraft.client.render.model.UnbakedModel;
|
||||
import net.minecraft.client.render.model.json.JsonUnbakedModel;
|
||||
import net.minecraft.client.texture.Sprite;
|
||||
import net.minecraft.client.util.ModelIdentifier;
|
||||
import net.minecraft.client.util.SpriteIdentifier;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.multiblock.MultiblockRenderer;
|
||||
import reborncore.common.powerSystem.RcEnergyItem;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import team.reborn.energy.api.base.SimpleBatteryItem;
|
||||
import techreborn.client.ClientGuiType;
|
||||
import techreborn.client.ClientboundPacketHandlers;
|
||||
import techreborn.client.render.DynamicBucketBakedModel;
|
||||
import techreborn.client.render.DynamicCellBakedModel;
|
||||
import techreborn.client.render.entitys.CableCoverRenderer;
|
||||
import techreborn.client.render.entitys.StorageUnitRenderer;
|
||||
import techreborn.client.render.entitys.TurbineRenderer;
|
||||
import techreborn.client.events.StackToolTipHandler;
|
||||
import techreborn.init.ModFluids;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.items.BatteryItem;
|
||||
import techreborn.items.DynamicCellItem;
|
||||
import techreborn.items.FrequencyTransmitterItem;
|
||||
import techreborn.items.armor.BatpackItem;
|
||||
import techreborn.items.tool.ChainsawItem;
|
||||
import techreborn.items.tool.industrial.NanosaberItem;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class TechRebornClient implements ClientModInitializer {
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
ModelLoadingRegistry.INSTANCE.registerAppender((manager, out) -> {
|
||||
out.accept(new ModelIdentifier(new Identifier(TechReborn.MOD_ID, "cell_base"), "inventory"));
|
||||
out.accept(new ModelIdentifier(new Identifier(TechReborn.MOD_ID, "cell_fluid"), "inventory"));
|
||||
out.accept(new ModelIdentifier(new Identifier(TechReborn.MOD_ID, "cell_background"), "inventory"));
|
||||
out.accept(new ModelIdentifier(new Identifier(TechReborn.MOD_ID, "cell_glass"), "inventory"));
|
||||
|
||||
out.accept(new ModelIdentifier(new Identifier(TechReborn.MOD_ID, "bucket_base"), "inventory"));
|
||||
out.accept(new ModelIdentifier(new Identifier(TechReborn.MOD_ID, "bucket_fluid"), "inventory"));
|
||||
out.accept(new ModelIdentifier(new Identifier(TechReborn.MOD_ID, "bucket_background"), "inventory"));
|
||||
});
|
||||
|
||||
ModelLoadingRegistry.INSTANCE.registerVariantProvider(resourceManager -> (modelIdentifier, modelProviderContext) -> {
|
||||
if (modelIdentifier.getNamespace().equals(TechReborn.MOD_ID)) {
|
||||
if (modelIdentifier.getPath().equals("cell")) {
|
||||
if (!RendererAccess.INSTANCE.hasRenderer()) {
|
||||
return JsonUnbakedModel.deserialize("{\"parent\":\"minecraft:item/generated\",\"textures\":{\"layer0\":\"techreborn:item/cell_background\"}}");
|
||||
}
|
||||
|
||||
return new UnbakedModel() {
|
||||
@Override
|
||||
public Collection<Identifier> getModelDependencies() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<SpriteIdentifier> getTextureDependencies(Function<Identifier, UnbakedModel> unbakedModelGetter, Set<Pair<String, String>> unresolvedTextureReferences) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BakedModel bake(ModelLoader loader, Function<SpriteIdentifier, Sprite> textureGetter, ModelBakeSettings rotationContainer, Identifier modelId) {
|
||||
return new DynamicCellBakedModel();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
Fluid fluid = Registry.FLUID.get(new Identifier(TechReborn.MOD_ID, modelIdentifier.getPath().split("_bucket")[0]));
|
||||
if (modelIdentifier.getPath().endsWith("_bucket") && fluid != Fluids.EMPTY) {
|
||||
if (!RendererAccess.INSTANCE.hasRenderer()) {
|
||||
return JsonUnbakedModel.deserialize("{\"parent\":\"minecraft:item/generated\",\"textures\":{\"layer0\":\"minecraft:item/bucket\"}}");
|
||||
}
|
||||
|
||||
return new UnbakedModel() {
|
||||
@Override
|
||||
public Collection<Identifier> getModelDependencies() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<SpriteIdentifier> getTextureDependencies(Function<Identifier, UnbakedModel> unbakedModelGetter, Set<Pair<String, String>> unresolvedTextureReferences) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BakedModel bake(ModelLoader loader, Function<SpriteIdentifier, Sprite> textureGetter, ModelBakeSettings rotationContainer, Identifier modelId) {
|
||||
return new DynamicBucketBakedModel();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
StackToolTipHandler.setup();
|
||||
ClientboundPacketHandlers.init();
|
||||
|
||||
GuiBase.wrenchStack = new ItemStack(TRContent.WRENCH);
|
||||
GuiBase.fluidCellProvider = DynamicCellItem::getCellWithFluid;
|
||||
|
||||
Arrays.stream(TRContent.Cables.values()).forEach(cable -> BlockRenderLayerMap.INSTANCE.putBlock(cable.block, RenderLayer.getCutout()));
|
||||
|
||||
BlockRenderLayerMap.INSTANCE.putBlock(TRContent.Machine.LAMP_INCANDESCENT.block, RenderLayer.getCutout());
|
||||
BlockRenderLayerMap.INSTANCE.putBlock(TRContent.Machine.LAMP_LED.block, RenderLayer.getCutout());
|
||||
BlockRenderLayerMap.INSTANCE.putBlock(TRContent.Machine.ALARM.block, RenderLayer.getCutout());
|
||||
BlockRenderLayerMap.INSTANCE.putBlock(TRContent.RUBBER_SAPLING, RenderLayer.getCutout());
|
||||
BlockRenderLayerMap.INSTANCE.putBlock(TRContent.REINFORCED_GLASS, RenderLayer.getCutout());
|
||||
BlockRenderLayerMap.INSTANCE.putBlock(TRContent.Machine.RESIN_BASIN.block, RenderLayer.getCutout());
|
||||
BlockRenderLayerMap.INSTANCE.putBlock(TRContent.POTTED_RUBBER_SAPLING, RenderLayer.getCutout());
|
||||
|
||||
BlockRenderLayerMap.INSTANCE.putBlock(TRContent.RUBBER_LEAVES, RenderLayer.getCutoutMipped());
|
||||
|
||||
for (ModFluids fluid : ModFluids.values()) {
|
||||
BlockRenderLayerMap.INSTANCE.putFluid(fluid.getFluid(), RenderLayer.getTranslucent());
|
||||
BlockRenderLayerMap.INSTANCE.putFluid(fluid.getFlowingFluid(), RenderLayer.getTranslucent());
|
||||
}
|
||||
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.INDUSTRIAL_GRINDER, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.FUSION_CONTROL_COMPUTER, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.INDUSTRIAL_BLAST_FURNACE, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.VACUUM_FREEZER, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.FLUID_REPLICATOR, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.INDUSTRIAL_SAWMILL, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.DISTILLATION_TOWER, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.IMPLOSION_COMPRESSOR, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.GREENHOUSE_CONTROLLER, MultiblockRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.STORAGE_UNIT, StorageUnitRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.CABLE, CableCoverRenderer::new);
|
||||
BlockEntityRendererRegistry.register(TRBlockEntities.WIND_MILL, TurbineRenderer::new);
|
||||
|
||||
registerPredicateProvider(
|
||||
BatpackItem.class,
|
||||
new Identifier("techreborn:empty"),
|
||||
(item, stack, world, entity, seed) -> {
|
||||
if (!stack.isEmpty() && SimpleBatteryItem.getStoredEnergyUnchecked(stack) == 0) {
|
||||
return 1.0F;
|
||||
}
|
||||
return 0.0F;
|
||||
}
|
||||
);
|
||||
|
||||
registerPredicateProvider(
|
||||
BatteryItem.class,
|
||||
new Identifier("techreborn:empty"),
|
||||
(item, stack, world, entity, seed) -> {
|
||||
if (!stack.isEmpty() && SimpleBatteryItem.getStoredEnergyUnchecked(stack) == 0) {
|
||||
return 1.0F;
|
||||
}
|
||||
return 0.0F;
|
||||
}
|
||||
);
|
||||
|
||||
registerPredicateProvider(
|
||||
FrequencyTransmitterItem.class,
|
||||
new Identifier("techreborn:coords"),
|
||||
(item, stack, world, entity, seed) -> {
|
||||
if (!stack.isEmpty() && stack.hasNbt() && stack.getOrCreateNbt().contains("x")
|
||||
&& stack.getOrCreateNbt().contains("y") && stack.getOrCreateNbt().contains("z")
|
||||
&& stack.getOrCreateNbt().contains("dim")) {
|
||||
return 1.0F;
|
||||
}
|
||||
return 0.0F;
|
||||
}
|
||||
);
|
||||
|
||||
registerPredicateProvider(
|
||||
ChainsawItem.class,
|
||||
new Identifier("techreborn:animated"),
|
||||
(item, stack, world, entity, seed) -> {
|
||||
if (!stack.isEmpty() && SimpleBatteryItem.getStoredEnergyUnchecked(stack) >= item.getCost() && entity != null && entity.getMainHandStack().equals(stack)) {
|
||||
return 1.0F;
|
||||
}
|
||||
return 0.0F;
|
||||
}
|
||||
);
|
||||
|
||||
registerPredicateProvider(
|
||||
NanosaberItem.class,
|
||||
new Identifier("techreborn:active"),
|
||||
(item, stack, world, entity, seed) -> {
|
||||
if (ItemUtils.isActive(stack)) {
|
||||
RcEnergyItem energyItem = (RcEnergyItem) stack.getItem();
|
||||
if (energyItem.getEnergyCapacity() - energyItem.getStoredEnergy(stack) >= 0.9 * item.getEnergyCapacity()) {
|
||||
return 0.5F;
|
||||
}
|
||||
return 1.0F;
|
||||
}
|
||||
return 0.0F;
|
||||
}
|
||||
);
|
||||
|
||||
ClientGuiType.validate();
|
||||
}
|
||||
|
||||
private static <T extends Item> void registerPredicateProvider(Class<T> itemClass, Identifier identifier, ItemModelPredicateProvider<T> modelPredicateProvider) {
|
||||
Registry.ITEM.stream()
|
||||
.filter(item -> item.getClass().isAssignableFrom(itemClass))
|
||||
.forEach(item -> ModelPredicateProviderRegistry.register(item, identifier, modelPredicateProvider));
|
||||
}
|
||||
|
||||
//Need the item instance in a few places, this makes it easier
|
||||
private interface ItemModelPredicateProvider<T extends Item> extends UnclampedModelPredicateProvider {
|
||||
|
||||
float call(T item, ItemStack stack, @Nullable ClientWorld world, @Nullable LivingEntity entity, int seed);
|
||||
|
||||
@Override
|
||||
default float unclampedCall(ItemStack stack, @Nullable ClientWorld world, @Nullable LivingEntity entity, int seed) {
|
||||
return call((T) stack.getItem(), stack, world, entity, seed);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -41,11 +41,11 @@ import org.apache.commons.lang3.Validate;
|
|||
import org.apache.commons.lang3.text.WordUtils;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.client.screen.builder.BlockEntityScreenHandlerBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.crafting.RebornRecipeType;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.screen.builder.BlockEntityScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import reborncore.common.util.serialization.SerializationUtil;
|
||||
import techreborn.blockentity.machine.GenericMachineBlockEntity;
|
||||
|
|
|
@ -28,7 +28,7 @@ import com.google.gson.JsonArray;
|
|||
import com.google.gson.JsonElement;
|
||||
import net.minecraft.util.JsonHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import reborncore.client.screen.builder.BlockEntityScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.BlockEntityScreenHandlerBuilder;
|
||||
import reborncore.common.util.serialization.SerializationUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
|
|
@ -24,7 +24,8 @@
|
|||
|
||||
package techreborn.blockentity.data;
|
||||
|
||||
import reborncore.client.screen.builder.BlockEntityScreenHandlerBuilder;
|
||||
|
||||
import reborncore.common.screen.builder.BlockEntityScreenHandlerBuilder;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.function.BiConsumer;
|
||||
|
|
|
@ -30,7 +30,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.fluid.FluidValue;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
|
|
|
@ -31,8 +31,6 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
@ -41,7 +39,7 @@ import org.jetbrains.annotations.Nullable;
|
|||
import reborncore.api.IToolDrop;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
|
|
|
@ -30,8 +30,8 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.fluid.FluidValue;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.blockentity.generator.BaseFluidGeneratorBlockEntity;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
|
|
|
@ -30,7 +30,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.fluid.FluidValue;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.blockentity.generator.BaseFluidGeneratorBlockEntity;
|
||||
|
|
|
@ -30,7 +30,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.fluid.FluidValue;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.blockentity.generator.BaseFluidGeneratorBlockEntity;
|
||||
|
|
|
@ -30,7 +30,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.fluid.FluidValue;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.blockentity.generator.BaseFluidGeneratorBlockEntity;
|
||||
|
|
|
@ -41,7 +41,7 @@ import reborncore.api.IToolDrop;
|
|||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
|
|
|
@ -28,7 +28,7 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.crafting.RebornRecipe;
|
||||
import reborncore.common.crafting.ingredient.RebornIngredient;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
|
|
|
@ -35,7 +35,7 @@ import net.minecraft.recipe.RecipeType;
|
|||
import net.minecraft.recipe.SmeltingRecipe;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
|
|
|
@ -35,7 +35,7 @@ import reborncore.api.IToolDrop;
|
|||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
|
|
|
@ -30,7 +30,7 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MultiblockWriter;
|
||||
import reborncore.common.crafting.RebornRecipe;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
|
|
|
@ -34,7 +34,7 @@ import net.minecraft.world.World;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.blockentity.MultiblockWriter;
|
||||
import reborncore.common.fluid.FluidValue;
|
||||
|
|
|
@ -30,14 +30,12 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.world.World;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.blockentity.MultiblockWriter;
|
||||
import reborncore.common.crafting.RebornRecipe;
|
||||
|
|
|
@ -30,7 +30,7 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MultiblockWriter;
|
||||
import reborncore.common.crafting.RebornRecipe;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
|
|
|
@ -34,7 +34,7 @@ import net.minecraft.util.math.Direction;
|
|||
import net.minecraft.world.BlockView;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MultiblockWriter;
|
||||
import reborncore.common.multiblock.IMultiblockPart;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
|
|
|
@ -35,7 +35,7 @@ import net.minecraft.world.World;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.blockentity.MultiblockWriter;
|
||||
import reborncore.common.fluid.FluidValue;
|
||||
|
|
|
@ -35,7 +35,7 @@ import net.minecraft.world.World;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.blockentity.MultiblockWriter;
|
||||
import reborncore.common.fluid.FluidValue;
|
||||
|
|
|
@ -30,7 +30,7 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraft.util.math.Direction;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MultiblockWriter;
|
||||
import reborncore.common.crafting.RebornRecipe;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
|
|
|
@ -8,8 +8,8 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.client.screen.builder.BlockEntityScreenHandlerBuilder;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.BlockEntityScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
|
|
|
@ -27,8 +27,8 @@ package techreborn.blockentity.machine.tier0.block;
|
|||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.client.screen.builder.BlockEntityScreenHandlerBuilder;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.BlockEntityScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
|
|
|
@ -27,8 +27,8 @@ package techreborn.blockentity.machine.tier0.block;
|
|||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.client.screen.builder.BlockEntityScreenHandlerBuilder;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.BlockEntityScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
|
|
|
@ -3,7 +3,7 @@ package techreborn.blockentity.machine.tier0.block;
|
|||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.client.screen.builder.BlockEntityScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.BlockEntityScreenHandlerBuilder;
|
||||
|
||||
public interface BlockProcessor {
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package techreborn.blockentity.machine.tier0.block.blockbreaker;
|
||||
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import reborncore.client.screen.builder.BlockEntityScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.BlockEntityScreenHandlerBuilder;
|
||||
import techreborn.blockentity.machine.tier0.block.ProcessingStatus;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package techreborn.blockentity.machine.tier0.block.blockplacer;
|
||||
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import reborncore.client.screen.builder.BlockEntityScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.BlockEntityScreenHandlerBuilder;
|
||||
import techreborn.blockentity.machine.tier0.block.ProcessingStatus;
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import techreborn.blockentity.machine.GenericMachineBlockEntity;
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import techreborn.blockentity.machine.GenericMachineBlockEntity;
|
||||
|
|
|
@ -45,7 +45,7 @@ import reborncore.api.IToolDrop;
|
|||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import techreborn.blockentity.machine.GenericMachineBlockEntity;
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import techreborn.blockentity.machine.GenericMachineBlockEntity;
|
||||
|
|
|
@ -38,7 +38,7 @@ import reborncore.api.IToolDrop;
|
|||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import techreborn.blockentity.machine.GenericMachineBlockEntity;
|
||||
|
|
|
@ -38,7 +38,7 @@ import reborncore.api.IToolDrop;
|
|||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.blockentity.MultiblockWriter;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
|
|
|
@ -36,7 +36,7 @@ import org.jetbrains.annotations.Nullable;
|
|||
import reborncore.api.IToolDrop;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.util.WorldUtils;
|
||||
|
|
|
@ -33,7 +33,7 @@ import net.minecraft.util.registry.Registry;
|
|||
import reborncore.api.blockentity.IUpgrade;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import techreborn.api.recipe.RecyclerRecipeCrafter;
|
||||
import techreborn.blockentity.machine.GenericMachineBlockEntity;
|
||||
|
|
|
@ -41,7 +41,7 @@ import reborncore.api.IToolDrop;
|
|||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import techreborn.api.recipe.ScrapboxRecipeCrafter;
|
||||
import techreborn.blockentity.machine.GenericMachineBlockEntity;
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import techreborn.blockentity.machine.GenericMachineBlockEntity;
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
import techreborn.blockentity.machine.GenericMachineBlockEntity;
|
||||
|
|
|
@ -39,7 +39,7 @@ import reborncore.api.IToolDrop;
|
|||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.chunkloading.ChunkLoaderManager;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
|
|
|
@ -27,7 +27,7 @@ package techreborn.blockentity.machine.tier3;
|
|||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
|
|
|
@ -35,7 +35,7 @@ import reborncore.api.IToolDrop;
|
|||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.jetbrains.annotations.Nullable;
|
|||
import reborncore.api.blockentity.IUpgrade;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.powerSystem.RcEnergyTier;
|
||||
import reborncore.common.util.RebornInventory;
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.powerSystem.RcEnergyTier;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.init.TRContent;
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.powerSystem.RcEnergyTier;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.init.TRContent;
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.powerSystem.RcEnergyTier;
|
||||
import techreborn.init.TRBlockEntities;
|
||||
import techreborn.init.TRContent;
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.powerSystem.RcEnergyTier;
|
||||
import team.reborn.energy.api.EnergyStorage;
|
||||
import team.reborn.energy.api.base.DelegatingEnergyStorage;
|
||||
|
|
|
@ -32,7 +32,7 @@ import net.minecraft.util.math.Direction;
|
|||
import net.minecraft.world.World;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.powerSystem.RcEnergyTier;
|
||||
import techreborn.blockentity.storage.energy.EnergyStorageBlockEntity;
|
||||
|
|
|
@ -29,8 +29,6 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -41,7 +39,7 @@ import reborncore.api.IToolDrop;
|
|||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.fluid.FluidValue;
|
||||
import reborncore.common.fluid.container.FluidInstance;
|
||||
|
|
|
@ -34,8 +34,6 @@ import net.minecraft.entity.player.PlayerEntity;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
@ -44,7 +42,7 @@ import org.jetbrains.annotations.Nullable;
|
|||
import reborncore.api.IListInfoProvider;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.api.blockentity.InventoryProvider;
|
||||
import reborncore.client.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.screen.builder.ScreenHandlerBuilder;
|
||||
import reborncore.common.blockentity.MachineBaseBlockEntity;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.screen.BuiltScreenHandlerProvider;
|
||||
|
|
|
@ -1,147 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.util.Identifier;
|
||||
import techreborn.blockentity.GuiType;
|
||||
import techreborn.blockentity.data.DataDrivenBEProvider;
|
||||
import techreborn.blockentity.generator.PlasmaGeneratorBlockEntity;
|
||||
import techreborn.blockentity.generator.SolarPanelBlockEntity;
|
||||
import techreborn.blockentity.generator.advanced.DieselGeneratorBlockEntity;
|
||||
import techreborn.blockentity.generator.advanced.GasTurbineBlockEntity;
|
||||
import techreborn.blockentity.generator.advanced.SemiFluidGeneratorBlockEntity;
|
||||
import techreborn.blockentity.generator.advanced.ThermalGeneratorBlockEntity;
|
||||
import techreborn.blockentity.generator.basic.SolidFuelGeneratorBlockEntity;
|
||||
import techreborn.blockentity.machine.iron.IronAlloyFurnaceBlockEntity;
|
||||
import techreborn.blockentity.machine.iron.IronFurnaceBlockEntity;
|
||||
import techreborn.blockentity.machine.misc.ChargeOMatBlockEntity;
|
||||
import techreborn.blockentity.machine.multiblock.*;
|
||||
import techreborn.blockentity.machine.tier0.block.BlockBreakerBlockEntity;
|
||||
import techreborn.blockentity.machine.tier0.block.BlockPlacerBlockEntity;
|
||||
import techreborn.blockentity.machine.tier1.*;
|
||||
import techreborn.blockentity.machine.tier3.ChunkLoaderBlockEntity;
|
||||
import techreborn.blockentity.machine.tier3.IndustrialCentrifugeBlockEntity;
|
||||
import techreborn.blockentity.machine.tier3.MatterFabricatorBlockEntity;
|
||||
import techreborn.blockentity.storage.energy.AdjustableSUBlockEntity;
|
||||
import techreborn.blockentity.storage.energy.HighVoltageSUBlockEntity;
|
||||
import techreborn.blockentity.storage.energy.LowVoltageSUBlockEntity;
|
||||
import techreborn.blockentity.storage.energy.MediumVoltageSUBlockEntity;
|
||||
import techreborn.blockentity.storage.energy.idsu.InterdimensionalSUBlockEntity;
|
||||
import techreborn.blockentity.storage.energy.lesu.LapotronicSUBlockEntity;
|
||||
import techreborn.blockentity.storage.fluid.TankUnitBaseBlockEntity;
|
||||
import techreborn.blockentity.storage.item.StorageUnitBaseBlockEntity;
|
||||
import techreborn.client.gui.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class ClientGuiType<T extends BlockEntity> {
|
||||
public static final Map<Identifier, ClientGuiType<?>> TYPES = new HashMap<>();
|
||||
|
||||
public static final ClientGuiType<AdjustableSUBlockEntity> AESU = register(GuiType.AESU, GuiAESU::new);
|
||||
public static final ClientGuiType<IronAlloyFurnaceBlockEntity> ALLOY_FURNACE = register(GuiType.ALLOY_FURNACE, GuiAlloyFurnace::new);
|
||||
public static final ClientGuiType<AlloySmelterBlockEntity> ALLOY_SMELTER = register(GuiType.ALLOY_SMELTER, GuiAlloySmelter::new);
|
||||
public static final ClientGuiType<AssemblingMachineBlockEntity> ASSEMBLING_MACHINE = register(GuiType.ASSEMBLING_MACHINE, GuiAssemblingMachine::new);
|
||||
public static final ClientGuiType<LowVoltageSUBlockEntity> LOW_VOLTAGE_SU = register(GuiType.LOW_VOLTAGE_SU, GuiBatbox::new);
|
||||
public static final ClientGuiType<AutoCraftingTableBlockEntity> AUTO_CRAFTING_TABLE = register(GuiType.AUTO_CRAFTING_TABLE, GuiAutoCrafting::new);
|
||||
public static final ClientGuiType<IndustrialBlastFurnaceBlockEntity> BLAST_FURNACE = register(GuiType.BLAST_FURNACE, GuiBlastFurnace::new);
|
||||
public static final ClientGuiType<IndustrialCentrifugeBlockEntity> CENTRIFUGE = register(GuiType.CENTRIFUGE, GuiCentrifuge::new);
|
||||
public static final ClientGuiType<ChargeOMatBlockEntity> CHARGEBENCH = register(GuiType.CHARGEBENCH, GuiChargeBench::new);
|
||||
public static final ClientGuiType<ChemicalReactorBlockEntity> CHEMICAL_REACTOR = register(GuiType.CHEMICAL_REACTOR, GuiChemicalReactor::new);
|
||||
public static final ClientGuiType<ChunkLoaderBlockEntity> CHUNK_LOADER = register(GuiType.CHUNK_LOADER, GuiChunkLoader::new);
|
||||
public static final ClientGuiType<CompressorBlockEntity> COMPRESSOR = register(GuiType.COMPRESSOR, GuiCompressor::new);
|
||||
public static final ClientGuiType<DieselGeneratorBlockEntity> DIESEL_GENERATOR = register(GuiType.DIESEL_GENERATOR, GuiDieselGenerator::new);
|
||||
public static final ClientGuiType<DistillationTowerBlockEntity> DISTILLATION_TOWER = register(GuiType.DISTILLATION_TOWER, GuiDistillationTower::new);
|
||||
public static final ClientGuiType<ElectricFurnaceBlockEntity> ELECTRIC_FURNACE = register(GuiType.ELECTRIC_FURNACE, GuiElectricFurnace::new);
|
||||
public static final ClientGuiType<ExtractorBlockEntity> EXTRACTOR = register(GuiType.EXTRACTOR, GuiExtractor::new);
|
||||
public static final ClientGuiType<FusionControlComputerBlockEntity> FUSION_CONTROLLER = register(GuiType.FUSION_CONTROLLER, GuiFusionReactor::new);
|
||||
public static final ClientGuiType<GasTurbineBlockEntity> GAS_TURBINE = register(GuiType.GAS_TURBINE, GuiGasTurbine::new);
|
||||
public static final ClientGuiType<SolidFuelGeneratorBlockEntity> GENERATOR = register(GuiType.GENERATOR, GuiGenerator::new);
|
||||
public static final ClientGuiType<HighVoltageSUBlockEntity> HIGH_VOLTAGE_SU = register(GuiType.HIGH_VOLTAGE_SU, GuiMFSU::new);
|
||||
public static final ClientGuiType<InterdimensionalSUBlockEntity> IDSU = register(GuiType.IDSU, GuiIDSU::new);
|
||||
public static final ClientGuiType<ImplosionCompressorBlockEntity> IMPLOSION_COMPRESSOR = register(GuiType.IMPLOSION_COMPRESSOR, GuiImplosionCompressor::new);
|
||||
public static final ClientGuiType<IndustrialElectrolyzerBlockEntity> INDUSTRIAL_ELECTROLYZER = register(GuiType.INDUSTRIAL_ELECTROLYZER, GuiIndustrialElectrolyzer::new);
|
||||
public static final ClientGuiType<IndustrialGrinderBlockEntity> INDUSTRIAL_GRINDER = register(GuiType.INDUSTRIAL_GRINDER, GuiIndustrialGrinder::new);
|
||||
public static final ClientGuiType<LapotronicSUBlockEntity> LESU = register(GuiType.LESU, GuiLESU::new);
|
||||
public static final ClientGuiType<MatterFabricatorBlockEntity> MATTER_FABRICATOR = register(GuiType.MATTER_FABRICATOR, GuiMatterFabricator::new);
|
||||
public static final ClientGuiType<MediumVoltageSUBlockEntity> MEDIUM_VOLTAGE_SU = register(GuiType.MEDIUM_VOLTAGE_SU, GuiMFE::new);
|
||||
public static final ClientGuiType<PlasmaGeneratorBlockEntity> PLASMA_GENERATOR = register(GuiType.PLASMA_GENERATOR, GuiPlasmaGenerator::new);
|
||||
public static final ClientGuiType<IronFurnaceBlockEntity> IRON_FURNACE = register(GuiType.IRON_FURNACE, GuiIronFurnace::new);
|
||||
public static final ClientGuiType<StorageUnitBaseBlockEntity> STORAGE_UNIT = register(GuiType.STORAGE_UNIT, GuiStorageUnit::new);
|
||||
public static final ClientGuiType<TankUnitBaseBlockEntity> TANK_UNIT = register(GuiType.TANK_UNIT, GuiTankUnit::new);
|
||||
public static final ClientGuiType<RecyclerBlockEntity> RECYCLER = register(GuiType.RECYCLER, GuiRecycler::new);
|
||||
public static final ClientGuiType<RollingMachineBlockEntity> ROLLING_MACHINE = register(GuiType.ROLLING_MACHINE, GuiRollingMachine::new);
|
||||
public static final ClientGuiType<IndustrialSawmillBlockEntity> SAWMILL = register(GuiType.SAWMILL, GuiIndustrialSawmill::new);
|
||||
public static final ClientGuiType<ScrapboxinatorBlockEntity> SCRAPBOXINATOR = register(GuiType.SCRAPBOXINATOR, GuiScrapboxinator::new);
|
||||
public static final ClientGuiType<SolarPanelBlockEntity> SOLAR_PANEL = register(GuiType.SOLAR_PANEL, GuiSolar::new);
|
||||
public static final ClientGuiType<SemiFluidGeneratorBlockEntity> SEMIFLUID_GENERATOR = register(GuiType.SEMIFLUID_GENERATOR, GuiSemifluidGenerator::new);
|
||||
public static final ClientGuiType<ThermalGeneratorBlockEntity> THERMAL_GENERATOR = register(GuiType.THERMAL_GENERATOR, GuiThermalGenerator::new);
|
||||
public static final ClientGuiType<VacuumFreezerBlockEntity> VACUUM_FREEZER = register(GuiType.VACUUM_FREEZER, GuiVacuumFreezer::new);
|
||||
public static final ClientGuiType<SolidCanningMachineBlockEntity> SOLID_CANNING_MACHINE = register(GuiType.SOLID_CANNING_MACHINE, GuiSolidCanningMachine::new);
|
||||
public static final ClientGuiType<WireMillBlockEntity> WIRE_MILL = register(GuiType.WIRE_MILL, GuiWireMill::new);
|
||||
public static final ClientGuiType<GreenhouseControllerBlockEntity> GREENHOUSE_CONTROLLER = register(GuiType.GREENHOUSE_CONTROLLER, GuiGreenhouseController::new);
|
||||
public static final ClientGuiType<FluidReplicatorBlockEntity> FLUID_REPLICATOR = register(GuiType.FLUID_REPLICATOR, GuiFluidReplicator::new);
|
||||
public static final ClientGuiType<PlayerDetectorBlockEntity> PLAYER_DETECTOR = register(GuiType.PLAYER_DETECTOR, GuiPlayerDetector::new);
|
||||
public static final ClientGuiType<DataDrivenBEProvider.DataDrivenBlockEntity> DATA_DRIVEN = register(GuiType.DATA_DRIVEN, DataDrivenGui::new);
|
||||
public static final ClientGuiType<BlockBreakerBlockEntity> BLOCK_BREAKER = register(GuiType.BLOCK_BREAKER, GuiBlockBreaker::new);
|
||||
public static final ClientGuiType<BlockPlacerBlockEntity> BLOCK_PLACER = register(GuiType.BLOCK_PLACER, GuiBlockPlacer::new);
|
||||
|
||||
private static <T extends BlockEntity> ClientGuiType<T> register(GuiType<T> type, GuiFactory<T> factory) {
|
||||
return new ClientGuiType<>(type, factory);
|
||||
}
|
||||
|
||||
public static void validate() {
|
||||
// Ensure all gui types also have a client version.
|
||||
for (Identifier identifier : GuiType.TYPES.keySet()) {
|
||||
Objects.requireNonNull(TYPES.get(identifier), "No ClientGuiType for " + identifier);
|
||||
}
|
||||
}
|
||||
|
||||
private final GuiType<T> guiType;
|
||||
private final GuiFactory<T> guiFactory;
|
||||
|
||||
public ClientGuiType(GuiType<T> guiType, GuiFactory<T> guiFactory) {
|
||||
this.guiType = Objects.requireNonNull(guiType);
|
||||
this.guiFactory = Objects.requireNonNull(guiFactory);
|
||||
|
||||
ScreenRegistry.register(guiType.getScreenHandlerType(), getGuiFactory());
|
||||
|
||||
TYPES.put(guiType.getIdentifier(), this);
|
||||
}
|
||||
|
||||
public GuiType<T> getGuiType() {
|
||||
return guiType;
|
||||
}
|
||||
|
||||
public GuiFactory<T> getGuiFactory() {
|
||||
return guiFactory;
|
||||
}
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import reborncore.client.ClientNetworkManager;
|
||||
import techreborn.client.gui.GuiManual;
|
||||
import techreborn.events.OreDepthSyncHandler;
|
||||
import techreborn.world.OreDepth;
|
||||
|
||||
import static techreborn.packets.ClientboundPackets.OPEN_MANUAL;
|
||||
import static techreborn.packets.ClientboundPackets.ORE_DEPTH;
|
||||
|
||||
public class ClientboundPacketHandlers {
|
||||
public static void init() {
|
||||
ClientNetworkManager.registerClientBoundHandler(ORE_DEPTH, OreDepth.LIST_CODEC, OreDepthSyncHandler::updateDepths);
|
||||
|
||||
ClientNetworkManager.registerClientBoundHandler(OPEN_MANUAL, (client, handler, buf, responseSender) ->
|
||||
client.execute(() ->
|
||||
MinecraftClient.getInstance().setScreen(new GuiManual())
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.client.gui.screen.ingame.HandledScreen;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public interface GuiFactory<T extends BlockEntity> extends ScreenRegistry.Factory<BuiltScreenHandler, HandledScreen<BuiltScreenHandler>> {
|
||||
HandledScreen<?> create(int syncId, PlayerEntity playerEntity, T blockEntity);
|
||||
|
||||
@Override
|
||||
default HandledScreen create(BuiltScreenHandler builtScreenHandler, PlayerInventory playerInventory, Text text) {
|
||||
PlayerEntity playerEntity = playerInventory.player;
|
||||
//noinspection unchecked
|
||||
T blockEntity = (T) builtScreenHandler.getBlockEntity();
|
||||
return create(builtScreenHandler.syncId, playerEntity, blockEntity);
|
||||
}
|
||||
}
|
|
@ -1,149 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.events;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.client.item.v1.ItemTooltipCallback;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.item.TooltipContext;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
import net.minecraft.fluid.FlowableFluid;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
import reborncore.common.BaseBlockEntityProvider;
|
||||
import techreborn.blocks.cable.CableBlock;
|
||||
import techreborn.events.OreDepthSyncHandler;
|
||||
import techreborn.init.TRContent;
|
||||
import techreborn.items.DynamicCellItem;
|
||||
import techreborn.items.UpgradeItem;
|
||||
import techreborn.world.OreDepth;
|
||||
import techreborn.world.TargetDimension;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class StackToolTipHandler implements ItemTooltipCallback {
|
||||
|
||||
public static final Map<Item, Boolean> ITEM_ID = Maps.newHashMap();
|
||||
private static final List<Block> UNOBTAINABLE_ORES = Lists.newLinkedList();
|
||||
|
||||
public static void setup() {
|
||||
ItemTooltipCallback.EVENT.register(new StackToolTipHandler());
|
||||
|
||||
for (TRContent.Ores ore : TRContent.Ores.values()) {
|
||||
if (ore.isDeepslate()) {
|
||||
TRContent.Ores normal = ore.getUnDeepslate();
|
||||
if (normal.distribution != null && normal.distribution.dimension != TargetDimension.OVERWORLD)
|
||||
UNOBTAINABLE_ORES.add(ore.block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(ItemStack stack, TooltipContext tooltipContext, List<Text> tooltipLines) {
|
||||
Item item = stack.getItem();
|
||||
|
||||
// Can currently be executed by a ForkJoinPool.commonPool-worker when REI is in async search mode
|
||||
// We skip this method until a thread-safe solution is in place
|
||||
if (!MinecraftClient.getInstance().isOnThread())
|
||||
return;
|
||||
|
||||
if (!ITEM_ID.computeIfAbsent(item, StackToolTipHandler::isTRItem))
|
||||
return;
|
||||
|
||||
// Machine info and upgrades helper section
|
||||
Block block = Block.getBlockFromItem(item);
|
||||
|
||||
if (block instanceof BaseBlockEntityProvider) {
|
||||
ToolTipAssistUtils.addInfo(item.getTranslationKey(), tooltipLines);
|
||||
}
|
||||
|
||||
if (block instanceof CableBlock cable) {
|
||||
BlockEntity blockEntity = cable.createBlockEntity(BlockPos.ORIGIN, block.getDefaultState());
|
||||
if (blockEntity != null) {
|
||||
((IListInfoProvider) blockEntity).addInfo(tooltipLines, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (item instanceof UpgradeItem upgrade) {
|
||||
ToolTipAssistUtils.addInfo(item.getTranslationKey(), tooltipLines, false);
|
||||
tooltipLines.addAll(ToolTipAssistUtils.getUpgradeStats(TRContent.Upgrades.valueOf(upgrade.name.toUpperCase()), stack.getCount(), Screen.hasShiftDown()));
|
||||
}
|
||||
|
||||
if (item instanceof DynamicCellItem cell) {
|
||||
Fluid fluid = cell.getFluid(stack);
|
||||
if (!(fluid instanceof FlowableFluid) && fluid != Fluids.EMPTY)
|
||||
ToolTipAssistUtils.addInfo("unplaceable_fluid", tooltipLines, false);
|
||||
}
|
||||
|
||||
if (item == TRContent.Upgrades.SUPERCONDUCTOR.item && Screen.hasControlDown()) {
|
||||
tooltipLines.add(Text.literal(Formatting.GOLD + "Blame obstinate_3 for this"));
|
||||
}
|
||||
|
||||
if (item == TRContent.OMNI_TOOL) {
|
||||
tooltipLines.add(Text.literal(Formatting.YELLOW + I18n.translate("techreborn.tooltip.omnitool_motto")));
|
||||
}
|
||||
|
||||
if (block == TRContent.Machine.INDUSTRIAL_CENTRIFUGE.block && Screen.hasControlDown()) {
|
||||
tooltipLines.add(Text.literal("Round and round it goes"));
|
||||
}
|
||||
|
||||
if (UNOBTAINABLE_ORES.contains(block)) {
|
||||
tooltipLines.add(Text.translatable("techreborn.tooltip.unobtainable").formatted(Formatting.AQUA));
|
||||
} else if (OreDepthSyncHandler.getOreDepthMap().containsKey(block)) {
|
||||
OreDepth oreDepth = OreDepthSyncHandler.getOreDepthMap().get(block);
|
||||
Text text = getOreDepthText(oreDepth);
|
||||
tooltipLines.add(text.copy().formatted(Formatting.AQUA));
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isTRItem(Item item) {
|
||||
return Registry.ITEM.getId(item).getNamespace().equals("techreborn");
|
||||
}
|
||||
|
||||
private static Text getOreDepthText(OreDepth depth) {
|
||||
return Text.translatable("techreborn.tooltip.ores.%s".formatted(depth.dimension().name().toLowerCase(Locale.ROOT)),
|
||||
Text.literal(String.valueOf(depth.minY())).formatted(Formatting.YELLOW),
|
||||
Text.literal(String.valueOf(depth.maxY())).formatted(Formatting.YELLOW)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,117 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.events;
|
||||
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
import techreborn.init.TRContent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ToolTipAssistUtils {
|
||||
|
||||
// Colour constants
|
||||
private static final Formatting instructColour = Formatting.BLUE;
|
||||
|
||||
private static final Formatting infoColour = Formatting.GOLD;
|
||||
private static final Formatting statColour = Formatting.GOLD;
|
||||
|
||||
private static final Formatting posColour = Formatting.GREEN;
|
||||
private static final Formatting negColour = Formatting.RED;
|
||||
|
||||
|
||||
public static List<Text> getUpgradeStats(TRContent.Upgrades upgradeType, int count, boolean shiftHeld) {
|
||||
List<Text> tips = new ArrayList<>();
|
||||
boolean shouldStackCalculate = count > 1;
|
||||
|
||||
switch (upgradeType) {
|
||||
case OVERCLOCKER -> {
|
||||
tips.add(getPositive(I18n.translate("techreborn.tooltip.upgrade.speed_increase"), calculateValue(TechRebornConfig.overclockerSpeed * 100, count, shiftHeld), "%"));
|
||||
tips.add(getNegative(I18n.translate("techreborn.tooltip.upgrade.energy_increase"), calculateValue(TechRebornConfig.overclockerPower * 100, count, shiftHeld), "%"));
|
||||
}
|
||||
case TRANSFORMER -> shouldStackCalculate = false;
|
||||
case ENERGY_STORAGE -> tips.add(getPositive(I18n.translate("techreborn.tooltip.upgrade.storage_increase"), calculateValue(TechRebornConfig.energyStoragePower, count, shiftHeld), " E"));
|
||||
case SUPERCONDUCTOR -> tips.add(getPositive(I18n.translate("techreborn.tooltip.upgrade.flow_increase"), calculateValue(Math.pow(2, (TechRebornConfig.superConductorCount + 2)) * 100, count, shiftHeld), "%"));
|
||||
}
|
||||
|
||||
// Add reminder that they can use shift to calculate the entire stack
|
||||
if (shouldStackCalculate && !shiftHeld) {
|
||||
tips.add(Text.literal(instructColour + I18n.translate("techreborn.tooltip.stack_info")));
|
||||
}
|
||||
|
||||
return tips;
|
||||
}
|
||||
|
||||
public static void addInfo(String inKey, List<Text> list) {
|
||||
addInfo(inKey, list, true);
|
||||
}
|
||||
|
||||
public static void addInfo(String inKey, List<Text> list, boolean hidden) {
|
||||
String key = ("techreborn.message.info." + inKey);
|
||||
|
||||
if (I18n.hasTranslation(key)) {
|
||||
if (!hidden || Screen.hasShiftDown()) {
|
||||
String info = I18n.translate(key);
|
||||
String[] infoLines = info.split("\\r?\\n");
|
||||
|
||||
for (String infoLine : infoLines) {
|
||||
list.add(1, Text.literal(infoColour + infoLine));
|
||||
}
|
||||
} else {
|
||||
list.add(Text.literal(instructColour + I18n.translate("techreborn.tooltip.more_info")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static int calculateValue(double value, int count, boolean shiftHeld) {
|
||||
int calculatedVal;
|
||||
|
||||
if (shiftHeld) {
|
||||
calculatedVal = (int) value * count;
|
||||
} else {
|
||||
calculatedVal = (int) value;
|
||||
}
|
||||
|
||||
return calculatedVal;
|
||||
}
|
||||
|
||||
private static Text getPositive(String text, int value, String unit) {
|
||||
return Text.literal(posColour + getStatStringUnit(text, value, unit));
|
||||
}
|
||||
|
||||
private static Text getNegative(String text, int value, String unit) {
|
||||
return Text.literal(negColour + getStatStringUnit(text, value, unit));
|
||||
}
|
||||
|
||||
private static String getStatStringUnit(String text, int value, String unit) {
|
||||
return text + ": " + statColour + value + unit;
|
||||
}
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.data.DataDrivenBEProvider;
|
||||
import techreborn.blockentity.data.DataDrivenSlot;
|
||||
import techreborn.blockentity.data.SlotType;
|
||||
|
||||
public class DataDrivenGui extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
private final DataDrivenBEProvider provider;
|
||||
private final DataDrivenBEProvider.DataDrivenBlockEntity blockEntity;
|
||||
|
||||
public DataDrivenGui(int syncID, final PlayerEntity player, final DataDrivenBEProvider.DataDrivenBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
this.provider = blockEntity.getProvider();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
final DataDrivenGui gui = this;
|
||||
|
||||
provider.getSlots().forEach(slot -> draw(matrixStack, gui, layer, slot));
|
||||
}
|
||||
|
||||
|
||||
public void draw(MatrixStack matrixStack, GuiBase<?> guiBase, GuiBase.Layer layer, DataDrivenSlot slot) {
|
||||
if (slot.type() == SlotType.OUTPUT) {
|
||||
guiBase.drawOutputSlot(matrixStack, slot.x(), slot.y(), layer);
|
||||
} else {
|
||||
guiBase.drawSlot(matrixStack, slot.x(), slot.y(), layer);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonUpDown;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonUpDown.UpDownButtonType;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.network.NetworkManager;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.blockentity.storage.energy.AdjustableSUBlockEntity;
|
||||
import techreborn.packets.ServerboundPackets;
|
||||
|
||||
public class GuiAESU extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
AdjustableSUBlockEntity blockEntity;
|
||||
|
||||
public GuiAESU(int syncID, final PlayerEntity player, final AdjustableSUBlockEntity aesu) {
|
||||
super(player, aesu, aesu.createScreenHandler(syncID, player));
|
||||
this.blockEntity = aesu;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
addDrawableChild(new GuiButtonUpDown(x + 121, y + 79, this, b -> onClick(256), UpDownButtonType.FASTFORWARD));
|
||||
addDrawableChild(new GuiButtonUpDown(x + 121 + 12, y + 79, this, b -> onClick(64), UpDownButtonType.FORWARD));
|
||||
addDrawableChild(new GuiButtonUpDown(x + 121 + 24, y + 79, this, b -> onClick(-64), UpDownButtonType.REWIND));
|
||||
addDrawableChild(new GuiButtonUpDown(x + 121 + 36, y + 79, this, b -> onClick(-256), UpDownButtonType.FASTREWIND));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
this.drawSlot(matrixStack, 62, 45, layer);
|
||||
this.drawSlot(matrixStack, 98, 45, layer);
|
||||
this.drawArmourSlots(matrixStack, 8, 18, layer);
|
||||
this.builder.drawEnergyOutput(matrixStack, this, 155, 61, this.blockEntity.getCurrentOutput(), layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
if (!hideGuiElements()) {
|
||||
matrixStack.push();
|
||||
matrixStack.scale(0.6f, 0.6f, 1.0f);
|
||||
Text text = Text.literal(PowerSystem.getLocalizedPowerNoSuffix(blockEntity.getEnergy()))
|
||||
.append("/")
|
||||
.append(PowerSystem.getLocalizedPowerNoSuffix(blockEntity.getMaxStoredPower()))
|
||||
.append(" ")
|
||||
.append(PowerSystem.getDisplayPower().abbreviation);
|
||||
|
||||
drawCentredText(matrixStack, text, 35, 0, 58, layer);
|
||||
matrixStack.pop();
|
||||
}
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
public void onClick(int amount) {
|
||||
NetworkManager.sendToServer(ServerboundPackets.createPacketAesu(amount, Screen.hasShiftDown(), Screen.hasControlDown(), blockEntity));
|
||||
}
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.iron.IronAlloyFurnaceBlockEntity;
|
||||
|
||||
public class GuiAlloyFurnace extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
IronAlloyFurnaceBlockEntity blockEntity;
|
||||
|
||||
public GuiAlloyFurnace(int syncID, PlayerEntity player, IronAlloyFurnaceBlockEntity alloyFurnace) {
|
||||
super(player, alloyFurnace, alloyFurnace.createScreenHandler(syncID, player));
|
||||
this.blockEntity = alloyFurnace;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, float lastFrameDuration, int mouseX, int mouseY) {
|
||||
super.drawBackground(matrixStack, lastFrameDuration, mouseX, mouseY);
|
||||
GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
// Input slots
|
||||
drawSlot(matrixStack, 47, 17, layer);
|
||||
drawSlot(matrixStack, 65, 17, layer);
|
||||
// Fuel slot
|
||||
drawSlot(matrixStack, 56, 53, layer);
|
||||
|
||||
drawOutputSlot(matrixStack, 116, 35, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, int mouseX, int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 85, 36, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawBurnBar(matrixStack, this, blockEntity.getBurnTimeRemainingScaled(100), 100, 56, 36, mouseX, mouseY, layer);
|
||||
}
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.tier1.AlloySmelterBlockEntity;
|
||||
|
||||
public class GuiAlloySmelter extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
AlloySmelterBlockEntity blockEntity;
|
||||
|
||||
public GuiAlloySmelter(int syncID, final PlayerEntity player, final AlloySmelterBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 34, 47, layer);
|
||||
drawSlot(matrixStack, 126, 47, layer);
|
||||
drawOutputSlot(matrixStack, 80, 47, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.tier1.AssemblingMachineBlockEntity;
|
||||
|
||||
public class GuiAssemblingMachine extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
AssemblingMachineBlockEntity blockEntity;
|
||||
|
||||
public GuiAssemblingMachine(int syncID, final PlayerEntity player, final AssemblingMachineBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float partialTicks, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, partialTicks, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
// Battery slot
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
|
||||
// Input slots
|
||||
drawSlot(matrixStack, 55, 35, layer);
|
||||
drawSlot(matrixStack, 55, 55, layer);
|
||||
|
||||
drawOutputSlot(matrixStack, 101, 45, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
|
@ -1,96 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.recipe.CraftingRecipe;
|
||||
import net.minecraft.util.Identifier;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.network.NetworkManager;
|
||||
import techreborn.blockentity.machine.tier1.AutoCraftingTableBlockEntity;
|
||||
import techreborn.packets.ServerboundPackets;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 20/06/2017.
|
||||
*/
|
||||
public class GuiAutoCrafting extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
static final Identifier RECIPE_BOOK_TEXTURE = new Identifier("textures/gui/recipe_book.png");
|
||||
boolean showGui = true;
|
||||
AutoCraftingTableBlockEntity blockEntityAutoCraftingTable;
|
||||
|
||||
public GuiAutoCrafting(int syncID, PlayerEntity player, AutoCraftingTableBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntityAutoCraftingTable = blockEntity;
|
||||
}
|
||||
|
||||
public void renderItemStack(ItemStack stack, int x, int y) {
|
||||
MinecraftClient.getInstance().getItemRenderer().renderInGuiWithOverrides(stack, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, int mouseX, int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntityAutoCraftingTable.getProgress(), blockEntityAutoCraftingTable.getMaxProgress(), 120, 44, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 26, (int) blockEntityAutoCraftingTable.getEnergy(), (int) blockEntityAutoCraftingTable.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, int mouseX, int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int j = 0; j < 3; j++) {
|
||||
drawSlot(matrixStack, 28 + (i * 18), 25 + (j * 18), layer);
|
||||
}
|
||||
}
|
||||
drawOutputSlot(matrixStack, 95, 42, layer);
|
||||
drawOutputSlot(matrixStack, 145, 42, layer);
|
||||
drawOutputSlot(matrixStack, 145, 70, layer);
|
||||
|
||||
CraftingRecipe recipe = blockEntityAutoCraftingTable.getCurrentRecipe();
|
||||
if (recipe != null) {
|
||||
renderItemStack(recipe.getOutput(), 95 + getGuiLeft(), 42 + getGuiTop());
|
||||
}
|
||||
|
||||
builder.drawLockButton(matrixStack, this, 145, 4, mouseX, mouseY, layer, blockEntityAutoCraftingTable.locked);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) {
|
||||
if (isPointInRect(145, 4, 20, 12, mouseX, mouseY)) {
|
||||
NetworkManager.sendToServer(ServerboundPackets.createPacketAutoCraftingTableLock(blockEntityAutoCraftingTable, !blockEntityAutoCraftingTable.locked));
|
||||
return true;
|
||||
}
|
||||
return super.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
}
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.blockentity.storage.energy.LowVoltageSUBlockEntity;
|
||||
|
||||
public class GuiBatbox extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
LowVoltageSUBlockEntity blockEntity;
|
||||
|
||||
public GuiBatbox(int syncID, final PlayerEntity player, final LowVoltageSUBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 62, 45, layer);
|
||||
drawSlot(matrixStack, 98, 45, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
if (!hideGuiElements()) {
|
||||
matrixStack.push();
|
||||
matrixStack.scale(0.6f, 0.6f, 1.0f);
|
||||
Text text = Text.literal(PowerSystem.getLocalizedPowerNoSuffix(blockEntity.getEnergy()))
|
||||
.append("/")
|
||||
.append(PowerSystem.getLocalizedPower(blockEntity.getMaxStoredPower()));
|
||||
|
||||
drawCentredText(matrixStack, text, 35, 0, 58, layer);
|
||||
matrixStack.pop();
|
||||
}
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonExtended;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.multiblock.IndustrialBlastFurnaceBlockEntity;
|
||||
|
||||
public class GuiBlastFurnace extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
private final IndustrialBlastFurnaceBlockEntity blockEntity;
|
||||
boolean hasMultiBlock;
|
||||
|
||||
public GuiBlastFurnace(int syncID, final PlayerEntity player, final IndustrialBlastFurnaceBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
this.hasMultiBlock = this.blockEntity.getCachedHeat() != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
this.hasMultiBlock = this.blockEntity.getCachedHeat() != 0;
|
||||
|
||||
final GuiBase.Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 50, 27, layer);
|
||||
drawSlot(matrixStack, 50, 47, layer);
|
||||
drawOutputSlotBar(matrixStack, 92, 36, 2, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
if (hasMultiBlock) {
|
||||
builder.drawHologramButton(matrixStack, this, 6, 4, mouseX, mouseY, layer);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
this.hasMultiBlock = blockEntity.getCachedHeat() != 0;
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 71, 40, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
|
||||
builder.drawBigHeatBar(matrixStack, this, 31, 71, blockEntity.getCachedHeat(), 3230, layer);
|
||||
if (hasMultiBlock) {
|
||||
addHologramButton(4, 4, 212, layer).clickHandler(this::onClick);
|
||||
} else {
|
||||
builder.drawMultiblockMissingBar(matrixStack, this, layer);
|
||||
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
|
||||
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
|
||||
}
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
public void onClick(GuiButtonExtended button, Double x, Double y) {
|
||||
blockEntity.renderMultiblock ^= !hideGuiElements();
|
||||
}
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.tier0.block.BlockBreakerBlockEntity;
|
||||
import techreborn.blockentity.machine.tier0.block.blockbreaker.BlockBreakerProcessor;
|
||||
|
||||
public class GuiBlockBreaker extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
BlockBreakerBlockEntity blockEntity;
|
||||
|
||||
public GuiBlockBreaker(int syncID, final PlayerEntity player, final BlockBreakerBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
BlockBreakerProcessor processor = blockEntity.getProcessor();
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
|
||||
drawCentredText(matrixStack, blockEntity.getProcessor().getStatusEnum().getText(), 25, processor.getStatusEnum().getColor(), layer);
|
||||
|
||||
drawCentredText(matrixStack, processor.getStatusEnum().getProgressText(processor.getProgress()), 40, processor.getStatusEnum().getColor(), layer);
|
||||
|
||||
drawOutputSlot(matrixStack, 80, 60, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.tier0.block.BlockPlacerBlockEntity;
|
||||
import techreborn.blockentity.machine.tier0.block.blockplacer.BlockPlacerProcessor;
|
||||
|
||||
public class GuiBlockPlacer extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
BlockPlacerBlockEntity blockEntity;
|
||||
|
||||
public GuiBlockPlacer(int syncID, final PlayerEntity player, final BlockPlacerBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
BlockPlacerProcessor processor = blockEntity.getProcessor();
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
|
||||
drawCentredText(matrixStack, blockEntity.getProcessor().getStatusEnum().getText(), 25, processor.getStatusEnum().getColor(), layer);
|
||||
|
||||
drawCentredText(matrixStack, processor.getStatusEnum().getProgressText(processor.getProgress()), 40, processor.getStatusEnum().getColor(), layer);
|
||||
|
||||
drawSlot(matrixStack, 80, 60, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
|
@ -1,69 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.tier3.IndustrialCentrifugeBlockEntity;
|
||||
|
||||
public class GuiCentrifuge extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
IndustrialCentrifugeBlockEntity blockEntity;
|
||||
|
||||
public GuiCentrifuge(int syncID, final PlayerEntity player, final IndustrialCentrifugeBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 40, 34, layer);
|
||||
drawSlot(matrixStack, 40, 54, layer);
|
||||
|
||||
drawSlot(matrixStack, 82, 44, layer);
|
||||
drawSlot(matrixStack, 101, 25, layer);
|
||||
drawSlot(matrixStack, 120, 44, layer);
|
||||
drawSlot(matrixStack, 101, 63, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 61, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.misc.ChargeOMatBlockEntity;
|
||||
|
||||
public class GuiChargeBench extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
ChargeOMatBlockEntity blockEntity;
|
||||
|
||||
public GuiChargeBench(int syncID, final PlayerEntity player, final ChargeOMatBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 62, 25, layer);
|
||||
drawSlot(matrixStack, 98, 25, layer);
|
||||
drawSlot(matrixStack, 62, 45, layer);
|
||||
drawSlot(matrixStack, 98, 45, layer);
|
||||
drawSlot(matrixStack, 62, 65, layer);
|
||||
drawSlot(matrixStack, 98, 65, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.tier1.ChemicalReactorBlockEntity;
|
||||
|
||||
public class GuiChemicalReactor extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
ChemicalReactorBlockEntity blockEntity;
|
||||
|
||||
public GuiChemicalReactor(int syncID, final PlayerEntity player, final ChemicalReactorBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 34, 47, layer);
|
||||
drawSlot(matrixStack, 126, 47, layer);
|
||||
drawOutputSlot(matrixStack, 80, 47, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.ClientChunkManager;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonUpDown;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonUpDown.UpDownButtonType;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.network.NetworkManager;
|
||||
import techreborn.blockentity.machine.tier3.ChunkLoaderBlockEntity;
|
||||
import techreborn.packets.ServerboundPackets;
|
||||
|
||||
public class GuiChunkLoader extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
ChunkLoaderBlockEntity blockEntity;
|
||||
|
||||
public GuiChunkLoader(int syncID, PlayerEntity player, ChunkLoaderBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
super.init();
|
||||
addDrawableChild(new GuiButtonUpDown(x + 64, y + 40, this, b -> onClick(5), UpDownButtonType.FASTFORWARD));
|
||||
addDrawableChild(new GuiButtonUpDown(x + 64 + 12, y + 40, this, b -> onClick(1), UpDownButtonType.FORWARD));
|
||||
addDrawableChild(new GuiButtonUpDown(x + 64 + 24, y + 40, this, b -> onClick(-1), UpDownButtonType.REWIND));
|
||||
addDrawableChild(new GuiButtonUpDown(x + 64 + 36, y + 40, this, b -> onClick(-5), UpDownButtonType.FASTREWIND));
|
||||
|
||||
addDrawableChild(new ButtonWidget(x + 10, y + 70, 155, 20, Text.literal("Toggle Loaded Chunks"), b -> ClientChunkManager.toggleLoadedChunks(blockEntity.getPos())));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, float partialTicks, int mouseX, int mouseY) {
|
||||
super.drawBackground(matrixStack, partialTicks, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
if (hideGuiElements()) return;
|
||||
|
||||
Text text = Text.literal("Radius: ")
|
||||
.append(String.valueOf(blockEntity.getRadius()));
|
||||
drawCentredText(matrixStack, text, 25, 4210752, layer);
|
||||
}
|
||||
|
||||
public void onClick(int amount) {
|
||||
NetworkManager.sendToServer(ServerboundPackets.createPacketChunkloader(amount, blockEntity, ClientChunkManager.hasChunksForLoader(blockEntity.getPos())));
|
||||
}
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.tier1.CompressorBlockEntity;
|
||||
|
||||
public class GuiCompressor extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
CompressorBlockEntity blockEntity;
|
||||
|
||||
public GuiCompressor(int syncID, final PlayerEntity player, final CompressorBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 55, 45, layer);
|
||||
drawOutputSlot(matrixStack, 101, 45, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
this.builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
this.builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.generator.advanced.DieselGeneratorBlockEntity;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class GuiDieselGenerator extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
DieselGeneratorBlockEntity blockEntity;
|
||||
|
||||
public GuiDieselGenerator(int syncID, final PlayerEntity player, final DieselGeneratorBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
drawSlot(matrixStack, 25, 35, layer);
|
||||
drawSlot(matrixStack, 25, 55, layer);
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,79 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonExtended;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.multiblock.DistillationTowerBlockEntity;
|
||||
|
||||
public class GuiDistillationTower extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
private final DistillationTowerBlockEntity blockEntity;
|
||||
|
||||
public GuiDistillationTower(int syncID, final PlayerEntity player, final DistillationTowerBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = Layer.BACKGROUND;
|
||||
// Battery slot
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
// Input slots
|
||||
drawSlot(matrixStack, 35, 27, layer);
|
||||
drawSlot(matrixStack, 35, 47, layer);
|
||||
// Four output slots
|
||||
drawOutputSlotBar(matrixStack, 78, 36, 4, layer);
|
||||
// JEI Button
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 55, 40, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
addHologramButton(6, 4, 212, layer).clickHandler(this::onClick);
|
||||
builder.drawHologramButton(matrixStack, this, 6, 4, mouseX, mouseY, layer);
|
||||
} else {
|
||||
builder.drawMultiblockMissingBar(matrixStack, this, layer);
|
||||
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
|
||||
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
|
||||
}
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
public void onClick(GuiButtonExtended button, Double x, Double y) {
|
||||
blockEntity.renderMultiblock ^= !hideGuiElements();
|
||||
}
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.tier1.ElectricFurnaceBlockEntity;
|
||||
|
||||
public class GuiElectricFurnace extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
ElectricFurnaceBlockEntity blockEntity;
|
||||
|
||||
public GuiElectricFurnace(int syncID, final PlayerEntity player, final ElectricFurnaceBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, float partialTicks, int mouseX, int mouseY) {
|
||||
super.drawBackground(matrixStack, partialTicks, mouseX, mouseY);
|
||||
Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 55, 45, layer);
|
||||
drawOutputSlot(matrixStack, 101, 45, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, int mouseX, int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.tier1.ExtractorBlockEntity;
|
||||
|
||||
public class GuiExtractor extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
ExtractorBlockEntity blockEntity;
|
||||
|
||||
public GuiExtractor(int syncID, final PlayerEntity player, final ExtractorBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 55, 45, layer);
|
||||
drawOutputSlot(matrixStack, 101, 45, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
|
@ -1,87 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonExtended;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.multiblock.FluidReplicatorBlockEntity;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*/
|
||||
public class GuiFluidReplicator extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
private final FluidReplicatorBlockEntity blockEntity;
|
||||
|
||||
public GuiFluidReplicator(int syncID, final PlayerEntity player, final FluidReplicatorBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
// Battery slot
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
// Input slot
|
||||
drawSlot(matrixStack, 55, 45, layer);
|
||||
// Liquid input slot
|
||||
drawSlot(matrixStack, 124, 35, layer);
|
||||
// Liquid output slot
|
||||
drawSlot(matrixStack, 124, 55, layer);
|
||||
// JEI button
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
builder.drawHologramButton(matrixStack, this, 6, 4, mouseX, mouseY, layer);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawTank(matrixStack, this, 99, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
addHologramButton(6, 4, 212, layer).clickHandler(this::onClick);
|
||||
} else {
|
||||
builder.drawMultiblockMissingBar(matrixStack, this, layer);
|
||||
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
|
||||
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
|
||||
}
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
// GuiScreen
|
||||
public void onClick(GuiButtonExtended button, Double x, Double y) {
|
||||
blockEntity.renderMultiblock ^= !hideGuiElements();
|
||||
}
|
||||
}
|
|
@ -1,136 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonExtended;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonUpDown;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonUpDown.UpDownButtonType;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.network.NetworkManager;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.util.Color;
|
||||
import reborncore.common.util.Torus;
|
||||
import techreborn.blockentity.machine.multiblock.FusionControlComputerBlockEntity;
|
||||
import techreborn.packets.ServerboundPackets;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public class GuiFusionReactor extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
private final FusionControlComputerBlockEntity blockEntity;
|
||||
|
||||
public GuiFusionReactor(int syncID, final PlayerEntity player, final FusionControlComputerBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
addDrawableChild(new GuiButtonUpDown(x + 121, y + 79, this, (ButtonWidget buttonWidget) -> sendSizeChange(5), UpDownButtonType.FASTFORWARD));
|
||||
addDrawableChild(new GuiButtonUpDown(x + 121 + 12, y + 79, this, (ButtonWidget buttonWidget) -> sendSizeChange(1), UpDownButtonType.FORWARD));
|
||||
addDrawableChild(new GuiButtonUpDown(x + 121 + 24, y + 79, this, (ButtonWidget buttonWidget) -> sendSizeChange(-1), UpDownButtonType.REWIND));
|
||||
addDrawableChild(new GuiButtonUpDown(x + 121 + 36, y + 79, this, (ButtonWidget buttonWidget) -> sendSizeChange(-5), UpDownButtonType.FASTREWIND));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float partialTicks, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, partialTicks, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 34, 47, layer);
|
||||
drawSlot(matrixStack, 126, 47, layer);
|
||||
drawOutputSlot(matrixStack, 80, 47, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
builder.drawHologramButton(matrixStack, this, 6, 4, mouseX, mouseY, layer);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 55, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 105, 51, mouseX, mouseY, GuiBuilder.ProgressDirection.LEFT, layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
addHologramButton(6, 4, 212, layer).clickHandler(this::hologramToggle);
|
||||
drawCentredText(matrixStack, blockEntity.getStateText(), 20, Color.BLUE.darker().getColor(), layer);
|
||||
if (blockEntity.state == 2) {
|
||||
drawCentredText(matrixStack, Text.literal(PowerSystem.getLocalizedPower(blockEntity.getPowerChange())).append("/t"), 30, Color.GREEN.darker().getColor(), layer);
|
||||
}
|
||||
} else {
|
||||
builder.drawMultiblockMissingBar(matrixStack, this, layer);
|
||||
addHologramButton(76, 56, 212, layer).clickHandler(this::hologramToggle);
|
||||
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
|
||||
|
||||
Optional<Pair<Integer, Integer>> stackSize = getCoilStackCount();
|
||||
if (stackSize.isPresent()) {
|
||||
if (stackSize.get().getLeft() > 0) {
|
||||
|
||||
drawCentredText(matrixStack,
|
||||
Text.literal("Required Coils: ")
|
||||
.append(String.valueOf(stackSize.get().getLeft()))
|
||||
.append("x64 +")
|
||||
.append(String.valueOf(stackSize.get().getRight()))
|
||||
, 25, 0xFFFFFF, layer);
|
||||
} else {
|
||||
drawCentredText(matrixStack, Text.literal("Required Coils: ").append(String.valueOf(stackSize.get().getRight())), 25, 0xFFFFFF, layer);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
drawTextWithShadow(matrixStack, this.textRenderer, Text.literal("Size: ").append(String.valueOf(blockEntity.size)), 83, 81, 0xFFFFFF);
|
||||
drawTextWithShadow(matrixStack, this.textRenderer, Text.literal(String.valueOf(blockEntity.getPowerMultiplier())).append("x"), 10, 81, 0xFFFFFF);
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, this.blockEntity.getEnergy(), this.blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
public void hologramToggle(GuiButtonExtended button, double x, double y) {
|
||||
blockEntity.renderMultiblock ^= !hideGuiElements();
|
||||
}
|
||||
|
||||
private void sendSizeChange(int sizeDelta) {
|
||||
NetworkManager.sendToServer(ServerboundPackets.createPacketFusionControlSize(sizeDelta, blockEntity.getPos()));
|
||||
}
|
||||
|
||||
public Optional<Pair<Integer, Integer>> getCoilStackCount() {
|
||||
if (!Torus.getTorusSizeCache().containsKey(blockEntity.size)) {
|
||||
return Optional.empty();
|
||||
}
|
||||
int count = Torus.getTorusSizeCache().get(blockEntity.size);
|
||||
return Optional.of(Pair.of(count / 64, count % 64));
|
||||
}
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.generator.advanced.GasTurbineBlockEntity;
|
||||
|
||||
public class GuiGasTurbine extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
GasTurbineBlockEntity blockEntity;
|
||||
|
||||
public GuiGasTurbine(int syncID, final PlayerEntity player, final GasTurbineBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
drawSlot(matrixStack, 25, 35, layer);
|
||||
drawSlot(matrixStack, 25, 55, layer);
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
|
||||
}
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.generator.basic.SolidFuelGeneratorBlockEntity;
|
||||
|
||||
public class GuiGenerator extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
SolidFuelGeneratorBlockEntity blockEntity;
|
||||
|
||||
public GuiGenerator(int syncID, final PlayerEntity player, final SolidFuelGeneratorBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 80, 54, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawBurnBar(matrixStack, this, blockEntity.getScaledBurnTime(100), 100, 81, 38, mouseX, mouseY, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
|
@ -1,111 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.client.resource.language.I18n;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonExtended;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.tier1.GreenhouseControllerBlockEntity;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class GuiGreenhouseController extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
private final GreenhouseControllerBlockEntity blockEntity;
|
||||
|
||||
public GuiGreenhouseController(int syncID, final PlayerEntity player, final GreenhouseControllerBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
|
||||
int gridYPos = 22;
|
||||
drawSlot(matrixStack, 30, gridYPos, layer);
|
||||
drawSlot(matrixStack, 48, gridYPos, layer);
|
||||
drawSlot(matrixStack, 30, gridYPos + 18, layer);
|
||||
drawSlot(matrixStack, 48, gridYPos + 18, layer);
|
||||
drawSlot(matrixStack, 30, gridYPos + 36, layer);
|
||||
drawSlot(matrixStack, 48, gridYPos + 36, layer);
|
||||
|
||||
if (!blockEntity.isMultiblockValid()) {
|
||||
RenderSystem.setShaderTexture(0, new Identifier("techreborn", "textures/item/part/digital_display.png"));
|
||||
drawTexture(matrixStack, x + 68, y + 22, 0, 0, 16, 16, 16, 16);
|
||||
if (isPointInRect(68, 22, 16, 16, mouseX, mouseY)) {
|
||||
List<Text> list = Arrays.stream(I18n.translate("techreborn.tooltip.greenhouse.upgrade_available")
|
||||
.split("\\r?\\n"))
|
||||
.map(Text::literal)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
matrixStack.push();
|
||||
renderTooltip(matrixStack, list, mouseX, mouseY);
|
||||
matrixStack.pop();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
addHologramButton(90, 24, 212, layer).clickHandler(this::onClick);
|
||||
builder.drawHologramButton(matrixStack, this, 90, 24, mouseX, mouseY, layer);
|
||||
|
||||
if (!blockEntity.isMultiblockValid()) {
|
||||
if (isPointInRect(68, 22, 16, 16, mouseX, mouseY)) {
|
||||
List<Text> list = Arrays.stream(I18n.translate("techreborn.tooltip.greenhouse.upgrade_available")
|
||||
.split("\\r?\\n"))
|
||||
.map(Text::literal)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
matrixStack.push();
|
||||
renderTooltip(matrixStack, list, mouseX - getGuiLeft(), mouseY - getGuiTop());
|
||||
matrixStack.pop();
|
||||
}
|
||||
}
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
public void onClick(GuiButtonExtended button, Double x, Double y) {
|
||||
blockEntity.renderMultiblock ^= !hideGuiElements();
|
||||
}
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.blockentity.storage.energy.idsu.InterdimensionalSUBlockEntity;
|
||||
|
||||
public class GuiIDSU extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
InterdimensionalSUBlockEntity idsu;
|
||||
|
||||
public GuiIDSU(int syncID, PlayerEntity player, InterdimensionalSUBlockEntity blockEntityIDSU) {
|
||||
super(player, blockEntityIDSU, blockEntityIDSU.createScreenHandler(syncID, player));
|
||||
idsu = blockEntityIDSU;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 62, 45, layer);
|
||||
drawSlot(matrixStack, 98, 45, layer);
|
||||
drawArmourSlots(matrixStack, 8, 18, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
matrixStack.push();
|
||||
matrixStack.scale(0.6f, 0.6f, 1.0f);
|
||||
|
||||
Text text = Text.literal(PowerSystem.getLocalizedPowerNoSuffix(idsu.getEnergy()))
|
||||
.append("/")
|
||||
.append(PowerSystem.getLocalizedPowerNoSuffix(idsu.getMaxStoredPower()))
|
||||
.append(" ")
|
||||
.append(PowerSystem.getDisplayPower().abbreviation);
|
||||
|
||||
drawCentredText(matrixStack, text, 35, 0, 58, layer);
|
||||
matrixStack.pop();
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) idsu.getEnergy(), (int) idsu.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,82 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonExtended;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.multiblock.ImplosionCompressorBlockEntity;
|
||||
|
||||
public class GuiImplosionCompressor extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
private final ImplosionCompressorBlockEntity blockEntity;
|
||||
|
||||
public GuiImplosionCompressor(int syncID, final PlayerEntity player, final ImplosionCompressorBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 50, 27, layer);
|
||||
drawSlot(matrixStack, 50, 47, layer);
|
||||
drawSlot(matrixStack, 92, 36, layer);
|
||||
drawSlot(matrixStack, 110, 36, layer);
|
||||
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
builder.drawHologramButton(matrixStack, this, 6, 4, mouseX, mouseY, layer);
|
||||
}
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 71, 40, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
addHologramButton(6, 4, 212, layer).clickHandler(this::onClick);
|
||||
} else {
|
||||
builder.drawMultiblockMissingBar(matrixStack, this, layer);
|
||||
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
|
||||
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
|
||||
}
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
public void onClick(GuiButtonExtended button, Double mouseX, Double mouseY) {
|
||||
blockEntity.renderMultiblock ^= !hideGuiElements();
|
||||
}
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.tier1.IndustrialElectrolyzerBlockEntity;
|
||||
|
||||
public class GuiIndustrialElectrolyzer extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
IndustrialElectrolyzerBlockEntity blockEntity;
|
||||
|
||||
public GuiIndustrialElectrolyzer(int syncID, final PlayerEntity player, final IndustrialElectrolyzerBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
//Battery slot
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
//Input slots
|
||||
drawSlot(matrixStack, 47, 72, layer);
|
||||
drawSlot(matrixStack, 81, 72, layer);
|
||||
//Output slots
|
||||
drawOutputSlotBar(matrixStack, 50, 23, 4, layer);
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 84, 52, mouseX, mouseY, GuiBuilder.ProgressDirection.UP, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,89 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonExtended;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.multiblock.IndustrialGrinderBlockEntity;
|
||||
|
||||
public class GuiIndustrialGrinder extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
private final IndustrialGrinderBlockEntity blockEntity;
|
||||
|
||||
public GuiIndustrialGrinder(int syncID, final PlayerEntity player, final IndustrialGrinderBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
// Battery slot
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
// Liquid input slot
|
||||
drawSlot(matrixStack, 34, 35, layer);
|
||||
// Liquid output slot
|
||||
drawSlot(matrixStack, 34, 55, layer);
|
||||
// Solid material input slot
|
||||
drawSlot(matrixStack, 84, 43, layer);
|
||||
// Output slots
|
||||
drawSlot(matrixStack, 126, 18, layer);
|
||||
drawSlot(matrixStack, 126, 36, layer);
|
||||
drawSlot(matrixStack, 126, 54, layer);
|
||||
drawSlot(matrixStack, 126, 72, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
builder.drawHologramButton(matrixStack, this, 6, 4, mouseX, mouseY, layer);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 105, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawTank(matrixStack, this, 53, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
addHologramButton(6, 4, 212, layer).clickHandler(this::onClick);
|
||||
} else {
|
||||
builder.drawMultiblockMissingBar(matrixStack, this, layer);
|
||||
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
|
||||
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
|
||||
}
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
public void onClick(GuiButtonExtended button, double mouseX, double mouseY) {
|
||||
blockEntity.renderMultiblock ^= !hideGuiElements();
|
||||
}
|
||||
}
|
|
@ -1,88 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonExtended;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.multiblock.IndustrialSawmillBlockEntity;
|
||||
|
||||
public class GuiIndustrialSawmill extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
private final IndustrialSawmillBlockEntity blockEntity;
|
||||
|
||||
public GuiIndustrialSawmill(int syncID, final PlayerEntity player, final IndustrialSawmillBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float partialTicks, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, partialTicks, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
// Battery slot
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
// Liquid input slot
|
||||
drawSlot(matrixStack, 34, 35, layer);
|
||||
// Liquid output slot
|
||||
drawSlot(matrixStack, 34, 55, layer);
|
||||
// Solid material input slot
|
||||
drawSlot(matrixStack, 84, 43, layer);
|
||||
// Output slots
|
||||
drawSlot(matrixStack, 126, 25, layer);
|
||||
drawSlot(matrixStack, 126, 43, layer);
|
||||
drawSlot(matrixStack, 126, 61, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
builder.drawHologramButton(matrixStack, this, 6, 4, mouseX, mouseY, layer);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 105, 47, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawTank(matrixStack, this, 53, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
if (blockEntity.isMultiblockValid()) {
|
||||
addHologramButton(6, 4, 212, layer).clickHandler(this::onClick);
|
||||
} else {
|
||||
builder.drawMultiblockMissingBar(matrixStack, this, layer);
|
||||
addHologramButton(76, 56, 212, layer).clickHandler(this::onClick);
|
||||
builder.drawHologramButton(matrixStack, this, 76, 56, mouseX, mouseY, layer);
|
||||
}
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
public void onClick(GuiButtonExtended button, Double mouseX, Double mouseY) {
|
||||
blockEntity.renderMultiblock ^= !hideGuiElements();
|
||||
}
|
||||
}
|
|
@ -1,126 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.widget.ButtonWidget;
|
||||
import net.minecraft.client.gui.widget.TexturedButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.network.NetworkManager;
|
||||
import techreborn.blockentity.machine.iron.IronFurnaceBlockEntity;
|
||||
import techreborn.packets.ServerboundPackets;
|
||||
import techreborn.utils.PlayerUtils;
|
||||
|
||||
public class GuiIronFurnace extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
IronFurnaceBlockEntity blockEntity;
|
||||
private static final Identifier EXP_BUTTON_TEXTURE = new Identifier("minecraft", "textures/item/experience_bottle.png");
|
||||
|
||||
|
||||
public GuiIronFurnace(int syncID, PlayerEntity player, IronFurnaceBlockEntity furnace) {
|
||||
super(player, furnace, furnace.createScreenHandler(syncID, player));
|
||||
this.blockEntity = furnace;
|
||||
}
|
||||
|
||||
public void onClick() {
|
||||
NetworkManager.sendToServer(ServerboundPackets.createPacketExperience(blockEntity));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
ButtonWidget.TooltipSupplier tooltipSupplier = (button, matrices, mouseX, mouseY) -> {
|
||||
PlayerEntity player = MinecraftClient.getInstance().player;
|
||||
if (player == null) { return; }
|
||||
String message = "Experience: ";
|
||||
|
||||
float furnaceExp = blockEntity.experience;
|
||||
if (furnaceExp <= 0) {
|
||||
message = message + "0";
|
||||
} else {
|
||||
float expTillLevel = (1.0F - player.experienceProgress) * player.getNextLevelExperience();
|
||||
if (furnaceExp <= expTillLevel) {
|
||||
int percentage = (int) (blockEntity.experience * 100 / player.getNextLevelExperience());
|
||||
message = message + "+"
|
||||
+ (percentage > 0 ? String.valueOf(percentage) : "<1")
|
||||
+ "%";
|
||||
} else {
|
||||
int levels = 0;
|
||||
furnaceExp -= expTillLevel;
|
||||
while (furnaceExp > 0) {
|
||||
furnaceExp -= PlayerUtils.getLevelExperience(player.experienceLevel);
|
||||
++levels;
|
||||
}
|
||||
message = message + "+" + levels + "L";
|
||||
}
|
||||
}
|
||||
|
||||
renderTooltip(matrices, Text.literal(message), mouseX, mouseY);
|
||||
};
|
||||
|
||||
addDrawableChild(new TexturedButtonWidget(
|
||||
getGuiLeft() + 116,
|
||||
getGuiTop() + 58,
|
||||
16,
|
||||
16,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
EXP_BUTTON_TEXTURE,
|
||||
16,
|
||||
16,
|
||||
b -> onClick(),
|
||||
tooltipSupplier,
|
||||
Text.empty()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, float lastFrameDuration, int mouseX, int mouseY) {
|
||||
super.drawBackground(matrixStack, lastFrameDuration, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
// Input slot
|
||||
drawSlot(matrixStack, 56, 17, layer);
|
||||
// Fuel slot
|
||||
drawSlot(matrixStack, 56, 53, layer);
|
||||
|
||||
drawOutputSlot(matrixStack, 116, 35, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, int mouseX, int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 85, 36, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawBurnBar(matrixStack, this, blockEntity.getBurnTimeRemainingScaled(100), 100, 56, 36, mouseX, mouseY, layer);
|
||||
}
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.blockentity.storage.energy.lesu.LapotronicSUBlockEntity;
|
||||
|
||||
public class GuiLESU extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
LapotronicSUBlockEntity blockEntity;
|
||||
|
||||
public GuiLESU(int syncID, final PlayerEntity player, final LapotronicSUBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 62, 45, layer);
|
||||
drawSlot(matrixStack, 98, 45, layer);
|
||||
drawArmourSlots(matrixStack, 8, 18, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
matrixStack.push();
|
||||
matrixStack.scale(0.6f, 0.6f, 1.0f);
|
||||
drawCentredText(matrixStack, Text.literal(PowerSystem.getLocalizedPowerNoSuffix( blockEntity.getEnergy()))
|
||||
.append("/")
|
||||
.append(PowerSystem.getLocalizedPowerNoSuffix(blockEntity.getMaxStoredPower()))
|
||||
.append(" ")
|
||||
.append(PowerSystem.getDisplayPower().abbreviation),
|
||||
35, 0, 58, layer);
|
||||
matrixStack.pop();
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.blockentity.storage.energy.MediumVoltageSUBlockEntity;
|
||||
|
||||
public class GuiMFE extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
MediumVoltageSUBlockEntity mfe;
|
||||
|
||||
public GuiMFE(int syncID, final PlayerEntity player, final MediumVoltageSUBlockEntity mfe) {
|
||||
super(player, mfe, mfe.createScreenHandler(syncID, player));
|
||||
this.mfe = mfe;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 62, 45, layer);
|
||||
drawSlot(matrixStack, 98, 45, layer);
|
||||
drawArmourSlots(matrixStack, 8, 18, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
if (!hideGuiElements()) {
|
||||
matrixStack.push();
|
||||
matrixStack.scale(0.6f, 0.6f, 1.0f);
|
||||
|
||||
drawCentredText(matrixStack, Text.literal(PowerSystem.getLocalizedPowerNoSuffix(mfe.getEnergy()))
|
||||
.append("/")
|
||||
.append(PowerSystem.getLocalizedPower(mfe.getMaxStoredPower()))
|
||||
, 35, 0, 58, layer);
|
||||
|
||||
matrixStack.pop();
|
||||
}
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) mfe.getEnergy(), (int) mfe.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.powerSystem.PowerSystem;
|
||||
import techreborn.blockentity.storage.energy.HighVoltageSUBlockEntity;
|
||||
|
||||
public class GuiMFSU extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
HighVoltageSUBlockEntity mfsu;
|
||||
|
||||
public GuiMFSU(int syncID, final PlayerEntity player, final HighVoltageSUBlockEntity mfsu) {
|
||||
super(player, mfsu, mfsu.createScreenHandler(syncID, player));
|
||||
this.mfsu = mfsu;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 62, 45, layer);
|
||||
drawSlot(matrixStack, 98, 45, layer);
|
||||
drawArmourSlots(matrixStack, 8, 18, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
matrixStack.push();
|
||||
matrixStack.scale(0.6f, 0.6f, 1.0f);
|
||||
drawCentredText(matrixStack, Text.literal(PowerSystem.getLocalizedPowerNoSuffix(mfsu.getEnergy()) + "/" + PowerSystem.getLocalizedPower(mfsu.getMaxStoredPower())), 35, 0, 58, layer);
|
||||
matrixStack.pop();
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 81, 28, (int) mfsu.getEnergy(), (int) mfsu.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
|
@ -1,100 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.client.gui.screen.ConfirmChatLinkScreen;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.Util;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonExtended;
|
||||
import reborncore.common.network.NetworkManager;
|
||||
import techreborn.config.TechRebornConfig;
|
||||
import techreborn.packets.ServerboundPackets;
|
||||
|
||||
public class GuiManual extends Screen {
|
||||
|
||||
private static final Identifier MANUAL_TEXTURE = new Identifier("techreborn", "textures/gui/manual.png");
|
||||
int guiWidth = 207;
|
||||
int guiHeight = 195;
|
||||
private static final Text text1 = Text.translatable("techreborn.manual.wiki");
|
||||
private static final Text text2 = Text.translatable("techreborn.manual.discord");
|
||||
private static final Text text3 = Text.translatable("techreborn.manual.refund");
|
||||
|
||||
public GuiManual() {
|
||||
super(Text.literal("gui.manual"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
int y = (height / 2) - guiHeight / 2;
|
||||
if (client == null) { return; }
|
||||
|
||||
addSelectableChild(new GuiButtonExtended((width / 2 - 30), y + 40, 60, 20, Text.translatable("techreborn.manual.wikibtn"), var1 -> client.setScreen(new ConfirmChatLinkScreen(t -> {
|
||||
if (t) {
|
||||
Util.getOperatingSystem().open("http://wiki.techreborn.ovh");
|
||||
}
|
||||
this.client.setScreen(this);
|
||||
}, "http://wiki.techreborn.ovh", false))));
|
||||
|
||||
addSelectableChild(new GuiButtonExtended((width / 2 - 30), y + 90, 60, 20, Text.translatable("techreborn.manual.discordbtn"), var1 -> client.setScreen(new ConfirmChatLinkScreen(t -> {
|
||||
if (t) {
|
||||
Util.getOperatingSystem().open("https://discord.gg/teamreborn");
|
||||
}
|
||||
this.client.setScreen(this);
|
||||
}, "https://discord.gg/teamreborn", false))));
|
||||
|
||||
if (TechRebornConfig.allowManualRefund) {
|
||||
addSelectableChild(new GuiButtonExtended((width / 2 - 30), y + 140, 60, 20, Text.translatable("techreborn.manual.refundbtn"), var1 -> {
|
||||
NetworkManager.sendToServer(ServerboundPackets.createRefundPacket());
|
||||
this.client.setScreen(null);
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
|
||||
renderBackground(matrixStack);
|
||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderSystem.setShaderTexture(0, MANUAL_TEXTURE);
|
||||
int centerX = (width / 2) - guiWidth / 2;
|
||||
int centerY = (height / 2) - guiHeight / 2;
|
||||
drawTexture(matrixStack, centerX, centerY, 0, 0, guiWidth, guiHeight);
|
||||
|
||||
textRenderer.draw(matrixStack, text1, (float) ((width / 2) - textRenderer.getWidth(text1) / 2), centerY + 40, 4210752);
|
||||
textRenderer.draw(matrixStack, text2, (float) ((width / 2) - textRenderer.getWidth(text2) / 2), centerY + 90, 4210752);
|
||||
if (TechRebornConfig.allowManualRefund) {
|
||||
textRenderer.draw(matrixStack, text3, (float) ((width / 2) - textRenderer.getWidth(text3) / 2), centerY + 140, 4210752);
|
||||
}
|
||||
|
||||
super.render(matrixStack, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.tier3.MatterFabricatorBlockEntity;
|
||||
|
||||
public class GuiMatterFabricator extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
MatterFabricatorBlockEntity blockEntity;
|
||||
|
||||
public GuiMatterFabricator(int syncID, final PlayerEntity player, final MatterFabricatorBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
|
||||
drawSlot(matrixStack, 30, 20, layer);
|
||||
drawSlot(matrixStack, 50, 20, layer);
|
||||
drawSlot(matrixStack, 70, 20, layer);
|
||||
drawSlot(matrixStack, 90, 20, layer);
|
||||
drawSlot(matrixStack, 110, 20, layer);
|
||||
drawSlot(matrixStack, 130, 20, layer);
|
||||
drawOutputSlotBar(matrixStack, 39, 65, 5, layer);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 83, 41, mouseX, mouseY, GuiBuilder.ProgressDirection.DOWN, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.generator.PlasmaGeneratorBlockEntity;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*/
|
||||
@Environment(EnvType.CLIENT)
|
||||
public class GuiPlasmaGenerator extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
PlasmaGeneratorBlockEntity blockEntity;
|
||||
|
||||
public GuiPlasmaGenerator(int syncID, final PlayerEntity player, final PlasmaGeneratorBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
drawSlot(matrixStack, 25, 35, layer);
|
||||
drawSlot(matrixStack, 25, 55, layer);
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,80 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Text;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.builder.widget.GuiButtonUpDown;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.network.NetworkManager;
|
||||
import techreborn.blockentity.machine.tier1.PlayerDetectorBlockEntity;
|
||||
import techreborn.packets.ServerboundPackets;
|
||||
|
||||
public class GuiPlayerDetector extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
PlayerDetectorBlockEntity blockEntity;
|
||||
|
||||
public GuiPlayerDetector(int syncID, final PlayerEntity player, final PlayerDetectorBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
private void onClick(int amount) {
|
||||
NetworkManager.sendToServer(ServerboundPackets.createPacketPlayerDetector(amount, blockEntity));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
addDrawableChild(new GuiButtonUpDown(x + 64, y + 40, this, b -> onClick(16), GuiButtonUpDown.UpDownButtonType.FASTFORWARD));
|
||||
addDrawableChild(new GuiButtonUpDown(x + 64 + 12, y + 40, this, b -> onClick(1), GuiButtonUpDown.UpDownButtonType.FORWARD));
|
||||
addDrawableChild(new GuiButtonUpDown(x + 64 + 24, y + 40, this, b -> onClick(-1), GuiButtonUpDown.UpDownButtonType.REWIND));
|
||||
addDrawableChild(new GuiButtonUpDown(x + 64 + 36, y + 40, this, b -> onClick(-16), GuiButtonUpDown.UpDownButtonType.FASTREWIND));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, float partialTicks, int mouseX, int mouseY) {
|
||||
super.drawBackground(matrixStack, partialTicks, mouseX, mouseY);
|
||||
final Layer layer = Layer.BACKGROUND;
|
||||
|
||||
if (hideGuiElements()) return;
|
||||
|
||||
Text text = Text.literal("Radius: ").append(String.valueOf(blockEntity.getCurrentRadius()));
|
||||
drawCentredText(matrixStack, text, 25, 4210752, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final Layer layer = Layer.FOREGROUND;
|
||||
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.tier1.RecyclerBlockEntity;
|
||||
|
||||
public class GuiRecycler extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
RecyclerBlockEntity blockEntity;
|
||||
|
||||
public GuiRecycler(int syncID, final PlayerEntity player, final RecyclerBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
// Battery slot
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
// Input
|
||||
drawSlot(matrixStack, 55, 45, layer);
|
||||
// Output
|
||||
drawOutputSlot(matrixStack, 101, 45, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
|
@ -1,86 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import reborncore.common.network.NetworkManager;
|
||||
import techreborn.blockentity.machine.tier1.RollingMachineBlockEntity;
|
||||
import techreborn.packets.ServerboundPackets;
|
||||
|
||||
public class GuiRollingMachine extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
RollingMachineBlockEntity rollingMachine;
|
||||
|
||||
public GuiRollingMachine(int syncID, final PlayerEntity player, final RollingMachineBlockEntity blockEntityRollingmachine) {
|
||||
super(player, blockEntityRollingmachine, blockEntityRollingmachine.createScreenHandler(syncID, player));
|
||||
this.rollingMachine = blockEntityRollingmachine;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
int gridYPos = 22;
|
||||
drawSlot(matrixStack, 30, gridYPos, layer);
|
||||
drawSlot(matrixStack, 48, gridYPos, layer);
|
||||
drawSlot(matrixStack, 66, gridYPos, layer);
|
||||
drawSlot(matrixStack, 30, gridYPos + 18, layer);
|
||||
drawSlot(matrixStack, 48, gridYPos + 18, layer);
|
||||
drawSlot(matrixStack, 66, gridYPos + 18, layer);
|
||||
drawSlot(matrixStack, 30, gridYPos + 36, layer);
|
||||
drawSlot(matrixStack, 48, gridYPos + 36, layer);
|
||||
drawSlot(matrixStack, 66, gridYPos + 36, layer);
|
||||
|
||||
drawSlot(matrixStack, 8, 70, layer);
|
||||
drawOutputSlot(matrixStack, 124, gridYPos + 18, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
builder.drawLockButton(matrixStack, this, 130, 4, mouseX, mouseY, layer, rollingMachine.locked);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, rollingMachine.getProgressScaled(100), 100, 92, 43, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 17, (int) rollingMachine.getEnergy(), (int) rollingMachine.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) {
|
||||
if (isPointInRect(130, 4, 20, 12, mouseX, mouseY)) {
|
||||
NetworkManager.sendToServer(ServerboundPackets.createPacketRollingMachineLock(rollingMachine, !rollingMachine.locked));
|
||||
return true;
|
||||
}
|
||||
return super.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.machine.tier1.ScrapboxinatorBlockEntity;
|
||||
|
||||
public class GuiScrapboxinator extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
ScrapboxinatorBlockEntity blockEntity;
|
||||
|
||||
public GuiScrapboxinator(int syncID, final PlayerEntity player, final ScrapboxinatorBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, float partialTicks, int mouseX, int mouseY) {
|
||||
super.drawBackground(matrixStack, partialTicks, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
|
||||
// Battery slot
|
||||
drawSlot(matrixStack, 8, 72, layer);
|
||||
// Scrapboxes input slot
|
||||
drawSlot(matrixStack, 55, 45, layer);
|
||||
// Output slot
|
||||
drawOutputSlot(matrixStack, 101, 45, layer);
|
||||
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(100), 100, 76, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 9, 19, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
}
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2020 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.client.gui;
|
||||
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import reborncore.client.gui.builder.GuiBase;
|
||||
import reborncore.client.gui.guibuilder.GuiBuilder;
|
||||
import reborncore.common.screen.BuiltScreenHandler;
|
||||
import techreborn.blockentity.generator.advanced.SemiFluidGeneratorBlockEntity;
|
||||
|
||||
public class GuiSemifluidGenerator extends GuiBase<BuiltScreenHandler> {
|
||||
|
||||
SemiFluidGeneratorBlockEntity blockEntity;
|
||||
|
||||
public GuiSemifluidGenerator(int syncID, final PlayerEntity player, final SemiFluidGeneratorBlockEntity blockEntity) {
|
||||
super(player, blockEntity, blockEntity.createScreenHandler(syncID, player));
|
||||
this.blockEntity = blockEntity;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground(MatrixStack matrixStack, final float f, final int mouseX, final int mouseY) {
|
||||
super.drawBackground(matrixStack, f, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
|
||||
drawSlot(matrixStack, 25, 35, layer);
|
||||
drawSlot(matrixStack, 25, 55, layer);
|
||||
builder.drawJEIButton(matrixStack, this, 158, 5, layer);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void drawForeground(MatrixStack matrixStack, final int mouseX, final int mouseY) {
|
||||
super.drawForeground(matrixStack, mouseX, mouseY);
|
||||
final GuiBase.Layer layer = GuiBase.Layer.FOREGROUND;
|
||||
|
||||
builder.drawProgressBar(matrixStack, this, blockEntity.getProgressScaled(10), 100, 83, 48, mouseX, mouseY, GuiBuilder.ProgressDirection.RIGHT, layer);
|
||||
builder.drawMultiEnergyBar(matrixStack, this, 130, 28, (int) blockEntity.getEnergy(), (int) blockEntity.getMaxStoredPower(), mouseX, mouseY, 0, layer);
|
||||
builder.drawTank(matrixStack, this, 44, 25, mouseX, mouseY, blockEntity.tank.getFluidInstance(), blockEntity.tank.getFluidValueCapacity(), blockEntity.tank.isEmpty(), layer);
|
||||
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue