Compare commits

..

No commits in common. "5f1c68f31f791133a63dd3aa1d2c4b3056034129" and "4cb639a94a8fd869d066d70d58acb758b25a51d7" have entirely different histories.

67 changed files with 187 additions and 262 deletions

View file

@ -710,9 +710,8 @@ a63b57c27d8548ddd13d64d18b098d4f5c127a30 data/actuallyadditions/recipes/restonia
85d2537a973d520c9eaaf2f15109c265faa2df3a data/actuallyadditions/recipes/rice_slime_potion.json
d4ca5d77d16ff6fdfc60e665694fdd97bce25463 data/actuallyadditions/recipes/shock_suppressor.json
655fab699bb97ec252deb61d91fbef6f4738fe1c data/actuallyadditions/recipes/single_battery.json
8cb9b0e94a5de6e0bb74d808207ddf041d444280 data/actuallyadditions/recipes/solid_fuel/charcoal.json
3a4c2b0ca2e150ef24edb2defe018f6574cb4827 data/actuallyadditions/recipes/solid_fuel/coal.json
9d2105a32a4781f3fd10a70f97ba243b1c0ceb34 data/actuallyadditions/recipes/solid_fuel/stick.json
f4b41a12da3d0d24f155a6fb0fc170eeea9947b0 data/actuallyadditions/recipes/solid_fuel/charcoal.json
ddae8379266c710a96811ab1d68bfb9973db7515 data/actuallyadditions/recipes/solid_fuel/coal.json
8ebd738f3968564e22ba6841eb821e5064c78588 data/actuallyadditions/recipes/stone_aiot.json
bc7a41d9f36cc43e146e0b727b6f439cc0d29343 data/actuallyadditions/recipes/teleport_staff.json
bdf7dbf563485903e444400d341e56d0bf308481 data/actuallyadditions/recipes/tiny_torch.json

View file

@ -3,6 +3,6 @@
"item": {
"item": "minecraft:charcoal"
},
"total_energy": 48000,
"burn_time": 1600
"total_energy": 1600,
"burn_time": 48000
}

View file

@ -3,6 +3,6 @@
"item": {
"item": "minecraft:coal"
},
"total_energy": 48000,
"burn_time": 1600
"total_energy": 1600,
"burn_time": 48000
}

View file

@ -29,17 +29,16 @@ public class SolidFuelGenerator extends RecipeProvider {
@Override
protected void buildShapelessRecipes(Consumer<IFinishedRecipe> consumer) {
addFuel(consumer, "coal", Items.COAL, 48000, 1600);
addFuel(consumer, "stick", Items.STICK, 1000, 200); //TEST
addFuel(consumer, "charcoal", Items.CHARCOAL, 48000, 1600);
}
private void addFuel(Consumer<IFinishedRecipe> consumer, String name, Item item, int energy, int burnTime) {
consumer.accept(new SolidFuelRecipe.FinishedRecipe(new ResourceLocation(ActuallyAdditions.MODID, "solid_fuel/"+name), Ingredient.of(item), energy, burnTime));
consumer.accept(new SolidFuelRecipe.FinishedRecipe(new ResourceLocation(ActuallyAdditions.MODID, "solid_fuel/"+name), Ingredient.of(item), burnTime, energy));
}
private void addFuel(Consumer<IFinishedRecipe> consumer, String name, Ingredient item, int energy, int burnTime) {
consumer.accept(new SolidFuelRecipe.FinishedRecipe(new ResourceLocation(ActuallyAdditions.MODID, "solid_fuel/"+name), item, energy, burnTime));
consumer.accept(new SolidFuelRecipe.FinishedRecipe(new ResourceLocation(ActuallyAdditions.MODID, "solid_fuel/"+name), item, burnTime, energy));
}
private void addFuel(Consumer<IFinishedRecipe> consumer, String name, ITag tag, int energy, int burnTime) {
consumer.accept(new SolidFuelRecipe.FinishedRecipe(new ResourceLocation(ActuallyAdditions.MODID, "solid_fuel/"+name), Ingredient.of(tag), energy, burnTime));
consumer.accept(new SolidFuelRecipe.FinishedRecipe(new ResourceLocation(ActuallyAdditions.MODID, "solid_fuel/"+name), Ingredient.of(tag), burnTime, energy));
}
}

View file

@ -89,7 +89,7 @@ public class BlockAtomicReconstructor extends FullyDirectionalBlock.Container im
}
@Nullable
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityAtomicReconstructor();
}

View file

@ -39,7 +39,7 @@ public class BlockBatteryBox extends BlockContainerBase {
// }
@Nullable
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityBatteryBox();
}

View file

@ -28,7 +28,7 @@ public class BlockBioReactor extends BlockContainerBase {
super(ActuallyBlocks.defaultPickProps(0, 2.0F, 10.0F));
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityBioReactor();
}

View file

@ -35,7 +35,7 @@ public class BlockBreaker extends FullyDirectionalBlock.Container {
}
@Nullable
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader world) {
return this.isPlacer
? new TileEntityPlacer()

View file

@ -40,7 +40,7 @@ public class BlockCanolaPress extends BlockContainerBase {
// }
@Nullable
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader world) {
return new TileEntityCanolaPress();
}

View file

@ -26,7 +26,6 @@ import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import net.minecraft.world.server.ServerWorld;
import javax.annotation.Nullable;
import java.util.Random;
public class BlockCoalGenerator extends DirectionalBlock.Container {
@ -35,13 +34,7 @@ public class BlockCoalGenerator extends DirectionalBlock.Container {
}
@Override
public boolean hasTileEntity(BlockState state) {
return true;
}
@Nullable
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityCoalGenerator();
}

View file

@ -48,7 +48,7 @@ public class BlockCoffeeMachine extends DirectionalBlock.Container {
}
@Nullable
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityCoffeeMachine();
}

View file

@ -47,7 +47,7 @@ public class BlockCrusher extends BlockContainerBase {
this.registerDefaultState(getStateDefinition().any().setValue(HORIZONTAL_FACING, Direction.NORTH).setValue(LIT, false));
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return this.isDouble
? new TileEntityCrusherDouble()

View file

@ -36,7 +36,7 @@ public class BlockDisplayStand extends BlockContainerBase {
}
@Nullable
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityDisplayStand();
}

View file

@ -28,7 +28,7 @@ public class BlockDropper extends FullyDirectionalBlock.Container {
super(ActuallyBlocks.defaultPickProps(0));
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityDropper();
}

View file

@ -35,7 +35,7 @@ public class BlockEmpowerer extends BlockContainerBase {
}
@Nullable
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityEmpowerer();
}

View file

@ -33,7 +33,7 @@ public class BlockEnergizer extends BlockContainerBase {
this.isEnergizer = isEnergizer;
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return this.isEnergizer
? new TileEntityEnergizer()

View file

@ -30,7 +30,7 @@ public class BlockFarmer extends DirectionalBlock.Container {
super(ActuallyBlocks.defaultPickProps(0));
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityFarmer();
}

View file

@ -30,7 +30,7 @@ public class BlockFeeder extends BlockContainerBase {
super(ActuallyBlocks.defaultPickProps(0, 0.5F, 6.0F));
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityFeeder();
}

View file

@ -33,7 +33,7 @@ public class BlockFermentingBarrel extends BlockContainerBase {
super(Properties.of(Material.WOOD).harvestTool(ToolType.AXE).harvestLevel(0).strength(0.5F, 5.0F).sound(SoundType.WOOD));
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityFermentingBarrel();
}

View file

@ -38,7 +38,7 @@ public class BlockFireworkBox extends BlockContainerBase {
return this.openGui(world, player, pos, TileEntityFireworkBox.class);
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityFireworkBox();
}

View file

@ -33,7 +33,7 @@ public class BlockFluidCollector extends FullyDirectionalBlock.Container {
this.isPlacer = isPlacer;
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return this.isPlacer
? new TileEntityFluidPlacer()

View file

@ -24,7 +24,7 @@ public class BlockHeatCollector extends BlockContainerBase {
super(ActuallyBlocks.defaultPickProps(0, 2.5F, 10.0F));
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityHeatCollector();
}

View file

@ -26,7 +26,7 @@ public class BlockItemInterface extends BlockContainerBase {
super(ActuallyBlocks.defaultPickProps(0));
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityItemInterface();
}

View file

@ -146,7 +146,7 @@ public class BlockLaserRelay extends FullyDirectionalBlock.Container implements
return ActionResultType.FAIL;
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader world) {
switch (this.type) {
case ITEM:

View file

@ -37,7 +37,7 @@ public class BlockLavaFactoryController extends DirectionalBlock.Container imple
super(ActuallyBlocks.defaultPickProps(0, 4.5F, 20.0F));
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityLavaFactoryController();
}

View file

@ -30,7 +30,7 @@ public class BlockLeafGenerator extends DirectionalBlock.Container {
super(Properties.of(Material.METAL).strength(5.0F, 10.0F).harvestTool(ToolType.PICKAXE).harvestLevel(0).strength(5.0F, 10.0F).sound(SoundType.METAL));
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityLeafGenerator();
}

View file

@ -30,7 +30,7 @@ public class BlockLongRangeBreaker extends FullyDirectionalBlock.Container {
super(ActuallyBlocks.defaultPickProps(0));
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityLongRangeBreaker();
}

View file

@ -36,7 +36,7 @@ public class BlockOilGenerator extends DirectionalBlock.Container {
super(ActuallyBlocks.defaultPickProps(0).randomTicks());
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityOilGenerator();
}

View file

@ -80,7 +80,7 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay {
return this.type == Type.PLACER || this.type == Type.BREAKER;
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
switch (this.type) {
case PLACER:

View file

@ -25,7 +25,7 @@ public class BlockPhantomBooster extends BlockContainerBase {
super(ActuallyBlocks.defaultPickProps(0));
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader world) {
return new TileEntityPhantomBooster();
}

View file

@ -38,7 +38,7 @@ public class BlockPlayerInterface extends BlockContainerBase implements IHudDisp
super(ActuallyBlocks.defaultPickProps(0, 4.5F, 10.0F));
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityPlayerInterface();
}

View file

@ -45,7 +45,7 @@ public class BlockPoweredFurnace extends BlockContainerBase {
registerDefaultState(getStateDefinition().any().setValue(HORIZONTAL_FACING, Direction.NORTH).setValue(LIT, false));
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityPoweredFurnace();
}

View file

@ -30,7 +30,7 @@ public class BlockRangedCollector extends BlockContainerBase {
super(ActuallyBlocks.defaultPickProps(0));
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityRangedCollector();
}

View file

@ -44,7 +44,7 @@ public class BlockVerticalDigger extends DirectionalBlock.Container implements I
return this.openGui(worldIn, player, pos, TileEntityVerticalDigger.class);
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader world) {
return new TileEntityVerticalDigger();
}

View file

@ -29,7 +29,7 @@ public class BlockXPSolidifier extends DirectionalBlock.Container {
super(ActuallyBlocks.defaultPickProps(0, 2.5F, 10.0F));
}
//@Override
@Override
public TileEntity newBlockEntity(IBlockReader worldIn) {
return new TileEntityXPSolidifier();
}

View file

@ -43,7 +43,7 @@ import net.minecraftforge.fml.network.NetworkHooks;
import javax.annotation.Nullable;
import java.util.Random;
public abstract class BlockContainerBase extends Block {
public abstract class BlockContainerBase extends ContainerBlock {
public BlockContainerBase(Properties properties) {
super(properties);
}
@ -51,13 +51,13 @@ public abstract class BlockContainerBase extends Block {
public ActionResultType openGui(World world, PlayerEntity player, BlockPos pos, Class<? extends INamedContainerProvider> expectedInstance) {
if (!world.isClientSide) {
TileEntity tile = world.getBlockEntity(pos);
if (expectedInstance.isInstance(tile)) {
if (tile != null && tile.getClass().isInstance(expectedInstance)) {
NetworkHooks.openGui((ServerPlayerEntity) player, (INamedContainerProvider) tile, pos);
}
return ActionResultType.SUCCESS;
}
return ActionResultType.SUCCESS;
return ActionResultType.PASS;
}
private void dropInventory(World world, BlockPos position) {

View file

@ -14,21 +14,21 @@ import net.minecraft.block.AbstractBlock.Properties;
* Wrapper for Directional block states extending from our base blocks. It's not super nice but it'll do.
*/
public abstract class DirectionalBlock extends BlockBase {
public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
// public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;
//
public DirectionalBlock(Properties properties) {
super(properties);
}
@Override
public BlockState getStateForPlacement(BlockItemUseContext context) {
return this.defaultBlockState().setValue(FACING, context.getNearestLookingDirection().getOpposite());
}
@Override
protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> builder) {
builder.add(FACING);
}
//
// @Override
// public BlockState getStateForPlacement(BlockItemUseContext context) {
// return this.getDefaultState().with(FACING, context.getNearestLookingDirection().getOpposite());
// }
//
// @Override
// protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
// builder.add(FACING);
// }
public abstract static class Container extends BlockContainerBase {
public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING;

View file

@ -91,6 +91,13 @@ public enum ConfigIntValues {
1,
Integer.MAX_VALUE,
"The energy use of the Atomic Reconstructor's Mining Lens."),
COAL_GENERATOR_CF_PRODUCTION(
"Coal Generator Energy Production",
ConfigCategories.MACHINE_VALUES,
30,
1,
Integer.MAX_VALUE,
"The Coal Generator's Energy Production in CF/tick while burning."),
LEAF_GENERATOR_COOLDOWN(
"Leaf Generator Cooldown",
ConfigCategories.MACHINE_VALUES,

View file

@ -26,10 +26,8 @@ import net.minecraft.util.text.TranslationTextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class CrusherScreen extends AAScreen<CrusherContainer> {
public class CrusherScreen extends GuiWtfMojang<CrusherContainer> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_grinder");
private static final ResourceLocation RES_LOC_DOUBLE = AssetUtil.getGuiLocation("gui_grinder_double");
@ -40,7 +38,7 @@ public class CrusherScreen extends AAScreen<CrusherContainer> {
private Button buttonAutoSplit;
public CrusherScreen(CrusherContainer container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.tileGrinder = container.tileGrinder;
this.isDouble = container.isDouble;
this.imageWidth = 176;
@ -78,7 +76,7 @@ public class CrusherScreen extends AAScreen<CrusherContainer> {
}
@Override
public void render(@Nonnull MatrixStack matrixStack, int x, int y, float f) {
public void render(MatrixStack matrixStack, int x, int y, float f) {
super.render(matrixStack, x, y, f);
this.energy.render(matrixStack, x, y);
@ -89,7 +87,7 @@ public class CrusherScreen extends AAScreen<CrusherContainer> {
}
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.tileGrinder);
}

View file

@ -17,10 +17,8 @@ import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.AbstractGui;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.client.gui.GuiUtils;
import java.text.NumberFormat;
import java.util.ArrayList;
@ -84,9 +82,9 @@ public class EnergyDisplay extends AbstractGui {
if (this.isMouseOver(mouseX, mouseY)) {
Minecraft mc = Minecraft.getInstance();
List<StringTextComponent> text = new ArrayList<>();
text.add(new StringTextComponent(this.getOverlayText()));
GuiUtils.drawHoveringText(matrices, text, mouseX, mouseY, mc.getWindow().getWidth(), mc.getWindow().getHeight(), -1, mc.font);
List<String> text = new ArrayList<>();
text.add(this.getOverlayText());
//GuiUtils.drawHoveringText(matrices, text, mouseX, mouseY, mc.getWindow().getWidth(), mc.getWindow().getHeight(), -1, mc.font);
}
}
@ -100,6 +98,6 @@ public class EnergyDisplay extends AbstractGui {
private String getOverlayText() {
NumberFormat format = NumberFormat.getInstance();
return String.format("%s/%s %s", format.format(this.rfReference.getEnergyStored()), format.format(this.rfReference.getMaxEnergyStored()), I18n.get("actuallyadditions.fe"));
return String.format("%s/%s %s", format.format(this.rfReference.getEnergyStored()), format.format(this.rfReference.getMaxEnergyStored()), I18n.get("actuallyadditions.cflong"));
}
}

View file

@ -19,9 +19,7 @@ import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import javax.annotation.Nonnull;
public class GuiBag extends AAScreen<ContainerBag> {
public class GuiBag extends GuiWtfMojang<ContainerBag> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_bag");
private static final ResourceLocation RES_LOC_VOID = AssetUtil.getGuiLocation("gui_void_bag");
@ -31,7 +29,7 @@ public class GuiBag extends AAScreen<ContainerBag> {
private Button buttonAutoInsert;
public GuiBag(ContainerBag container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.imageWidth = 176;
this.imageHeight = 90 + 86;
this.isVoid = container.isVoid;
@ -77,7 +75,7 @@ public class GuiBag extends AAScreen<ContainerBag> {
}*/
@Override
public void render(@Nonnull MatrixStack stack, int mouseX, int mouseY, float partialTicks) {
public void render(MatrixStack stack, int mouseX, int mouseY, float partialTicks) {
super.render(stack, mouseX, mouseY, partialTicks);
this.filter.drawHover(mouseX, mouseY);

View file

@ -20,16 +20,14 @@ import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import javax.annotation.Nonnull;
public class GuiBioReactor extends AAScreen<ContainerBioReactor> {
public class GuiBioReactor extends GuiWtfMojang<ContainerBioReactor> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_bio_reactor");
private final TileEntityBioReactor tile;
private EnergyDisplay energy;
public GuiBioReactor(ContainerBioReactor container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.tile = container.tile;
this.imageWidth = 176;
this.imageHeight = 93 + 86;
@ -42,13 +40,13 @@ public class GuiBioReactor extends AAScreen<ContainerBioReactor> {
}
@Override
public void render(@Nonnull MatrixStack matrices, int mouseX, int mouseY, float partialTicks) {
public void render(MatrixStack matrices, int mouseX, int mouseY, float partialTicks) {
super.render(matrices, mouseX, mouseY, partialTicks);
//this.energy.render(mouseX, mouseY);
}
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.tile);
}

View file

@ -21,23 +21,26 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class GuiBreaker extends AAScreen<ContainerBreaker> {
public class GuiBreaker extends GuiWtfMojang<ContainerBreaker> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_breaker");
private final TileEntityBreaker breaker;
public GuiBreaker(ContainerBreaker container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.breaker = container.breaker;
this.imageWidth = 176;
this.imageHeight = 93 + 86;
}
@Override
protected void renderBg(@Nonnull MatrixStack matrices, float partialTicks, int x, int y) {
protected void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.breaker);
}
@Override
protected void renderBg(MatrixStack matrices, float partialTicks, int x, int y) {
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
this.getMinecraft().getTextureManager().bind(AssetUtil.GUI_INVENTORY_LOCATION);

View file

@ -21,10 +21,8 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class GuiCanolaPress extends AAScreen<ContainerCanolaPress> {
public class GuiCanolaPress extends GuiWtfMojang<ContainerCanolaPress> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_canola_press");
private final TileEntityCanolaPress press;
@ -32,7 +30,7 @@ public class GuiCanolaPress extends AAScreen<ContainerCanolaPress> {
private FluidDisplay fluid;
public GuiCanolaPress(ContainerCanolaPress container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.press = container.press;
this.imageWidth = 176;
this.imageHeight = 93 + 86;
@ -46,7 +44,7 @@ public class GuiCanolaPress extends AAScreen<ContainerCanolaPress> {
}
@Override
public void render(@Nonnull MatrixStack matrices, int x, int y, float f) {
public void render(MatrixStack matrices, int x, int y, float f) {
super.render(matrices, x, y, f);
this.energy.render(matrices, x, y);
@ -54,7 +52,7 @@ public class GuiCanolaPress extends AAScreen<ContainerCanolaPress> {
}
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.press);
}

View file

@ -15,25 +15,21 @@ import com.mojang.blaze3d.systems.RenderSystem;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerCoalGenerator;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoalGenerator;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class GuiCoalGenerator extends AAScreen<ContainerCoalGenerator> {
public class GuiCoalGenerator extends GuiWtfMojang<ContainerCoalGenerator> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_coal_generator");
private final TileEntityCoalGenerator generator;
private EnergyDisplay energy;
public GuiCoalGenerator(ContainerCoalGenerator container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.generator = container.generator;
this.imageWidth = 176;
this.imageHeight = 93 + 86;
@ -43,16 +39,17 @@ public class GuiCoalGenerator extends AAScreen<ContainerCoalGenerator> {
public void init() {
super.init();
this.energy = new EnergyDisplay(this.leftPos + 42, this.topPos + 5, this.generator.storage);
titleLabelX = (int) (imageWidth / 2.0f - font.width(title) / 2.0f);
titleLabelY = -10;
}
@Override
public void render(@Nonnull MatrixStack matrices, int x, int y, float f) {
renderBackground(matrices);
public void render(MatrixStack matrices, int x, int y, float f) {
super.render(matrices, x, y, f);
this.energy.render(matrices, x, y);
renderTooltip(matrices, x, y);
}
@Override
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.generator);
}
@Override

View file

@ -23,10 +23,8 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class GuiCoffeeMachine extends AAScreen<ContainerCoffeeMachine> {
public class GuiCoffeeMachine extends GuiWtfMojang<ContainerCoffeeMachine> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_coffee_machine");
private final TileEntityCoffeeMachine machine;
@ -35,7 +33,7 @@ public class GuiCoffeeMachine extends AAScreen<ContainerCoffeeMachine> {
private FluidDisplay fluid;
public GuiCoffeeMachine(ContainerCoffeeMachine container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.machine = container.machine;
this.imageWidth = 176;
this.imageHeight = 93 + 86;
@ -53,7 +51,7 @@ public class GuiCoffeeMachine extends AAScreen<ContainerCoffeeMachine> {
}
@Override
public void render(@Nonnull MatrixStack matrices, int x, int y, float f) {
public void render(MatrixStack matrices, int x, int y, float f) {
super.render(matrices, x, y, f);
String text2 = this.machine.coffeeCacheAmount + "/" + TileEntityCoffeeMachine.COFFEE_CACHE_MAX_AMOUNT + " " + StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.coffee");
@ -66,7 +64,7 @@ public class GuiCoffeeMachine extends AAScreen<ContainerCoffeeMachine> {
}
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.machine);
}

View file

@ -21,17 +21,15 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class GuiDirectionalBreaker extends AAScreen<ContainerDirectionalBreaker> {
public class GuiDirectionalBreaker extends GuiWtfMojang<ContainerDirectionalBreaker> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_directional_breaker");
private final TileEntityLongRangeBreaker breaker;
private EnergyDisplay energy;
public GuiDirectionalBreaker(ContainerDirectionalBreaker container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.breaker = container.breaker;
this.imageWidth = 176;
this.imageHeight = 93 + 86;
@ -44,14 +42,14 @@ public class GuiDirectionalBreaker extends AAScreen<ContainerDirectionalBreaker>
}
@Override
public void render(@Nonnull MatrixStack matrices, int x, int y, float f) {
public void render(MatrixStack matrices, int x, int y, float f) {
super.render(matrices, x, y, f);
this.energy.render(matrices, x, y);
}
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.breaker);
}

View file

@ -22,22 +22,20 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class GuiDrill extends AAScreen<ContainerDrill> {
public class GuiDrill extends GuiWtfMojang<ContainerDrill> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_drill");
public GuiDrill(ContainerDrill container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.imageWidth = 176;
this.imageHeight = 54 + 86;
}
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, StringUtil.localize("container." + ActuallyAdditions.MODID + ".drill.name"));
}

View file

@ -21,24 +21,22 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class GuiDropper extends AAScreen<ContainerDropper> {
public class GuiDropper extends GuiWtfMojang<ContainerDropper> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_breaker");
private final TileEntityDropper dropper;
public GuiDropper(ContainerDropper container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.dropper = container.dropper;
this.imageWidth = 176;
this.imageHeight = 93 + 86;
}
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.dropper);
}

View file

@ -21,17 +21,15 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class GuiEnergizer extends AAScreen<ContainerEnergizer> {
public class GuiEnergizer extends GuiWtfMojang<ContainerEnergizer> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_energizer");
private final TileEntityEnergizer energizer;
private EnergyDisplay energy;
public GuiEnergizer(ContainerEnergizer container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.energizer = container.energizer;
this.imageWidth = 176;
this.imageHeight = 93 + 86;
@ -44,13 +42,13 @@ public class GuiEnergizer extends AAScreen<ContainerEnergizer> {
}
@Override
public void render(@Nonnull MatrixStack matrices, int x, int y, float f) {
public void render(MatrixStack matrices, int x, int y, float f) {
super.render(matrices, x, y, f);
this.energy.render(matrices, x, y);
}
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.energizer);
}

View file

@ -21,18 +21,16 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class GuiEnervator extends AAScreen<ContainerEnervator> {
public class GuiEnervator extends GuiWtfMojang<ContainerEnervator> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_energizer");
private final TileEntityEnervator enervator;
private EnergyDisplay energy;
public GuiEnervator(ContainerEnervator container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.enervator = container.enervator;
this.imageWidth = 176;
this.imageHeight = 93 + 86;
@ -45,13 +43,13 @@ public class GuiEnervator extends AAScreen<ContainerEnervator> {
}
@Override
public void render(@Nonnull MatrixStack matrices, int x, int y, float f) {
public void render(MatrixStack matrices, int x, int y, float f) {
super.render(matrices, x, y, f);
this.energy.render(matrices, x, y);
}
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.enervator);
}

View file

@ -21,11 +21,9 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class GuiFarmer extends AAScreen<ContainerFarmer> {
public class GuiFarmer extends GuiWtfMojang<ContainerFarmer> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_farmer");
private final TileEntityFarmer farmer;
@ -33,7 +31,7 @@ public class GuiFarmer extends AAScreen<ContainerFarmer> {
private EnergyDisplay energy;
public GuiFarmer(ContainerFarmer container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.farmer = container.farmer;
this.imageWidth = 176;
this.imageHeight = 93 + 86;
@ -47,7 +45,7 @@ public class GuiFarmer extends AAScreen<ContainerFarmer> {
}
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.farmer);
}
@ -65,7 +63,7 @@ public class GuiFarmer extends AAScreen<ContainerFarmer> {
}
@Override
public void render(@Nonnull MatrixStack matrices, int x, int y, float f) {
public void render(MatrixStack matrices, int x, int y, float f) {
super.render(matrices, x, y, f);
this.energy.render(matrices, x, y);
}

View file

@ -23,23 +23,21 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class GuiFeeder extends AAScreen<ContainerFeeder> {
public class GuiFeeder extends GuiWtfMojang<ContainerFeeder> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_feeder");
public final TileEntityFeeder tileFeeder;
public GuiFeeder(ContainerFeeder container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.tileFeeder = container.feeder;
this.imageWidth = 176;
this.imageHeight = 70 + 86;
}
@Override
public void render(@Nonnull MatrixStack matrices, int x, int y, float f) {
public void render(MatrixStack matrices, int x, int y, float f) {
super.render(matrices, x, y, f);
if (x >= this.leftPos + 69 && y >= this.topPos + 30 && x <= this.leftPos + 69 + 10 && y <= this.topPos + 30 + 10) {
String[] array = new String[]{this.tileFeeder.currentAnimalAmount + " " + StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.animals"), this.tileFeeder.currentAnimalAmount >= 2 && this.tileFeeder.currentAnimalAmount < TileEntityFeeder.THRESHOLD
@ -52,7 +50,7 @@ public class GuiFeeder extends AAScreen<ContainerFeeder> {
}
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.tileFeeder);
}

View file

@ -21,11 +21,9 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class GuiFermentingBarrel extends AAScreen<ContainerFermentingBarrel> {
public class GuiFermentingBarrel extends GuiWtfMojang<ContainerFermentingBarrel> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_fermenting_barrel");
private final TileEntityFermentingBarrel press;
@ -33,14 +31,14 @@ public class GuiFermentingBarrel extends AAScreen<ContainerFermentingBarrel> {
private FluidDisplay output;
public GuiFermentingBarrel(ContainerFermentingBarrel container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.press = container.barrel;
this.imageWidth = 176;
this.imageHeight = 93 + 86;
}
@Override
public void render(@Nonnull MatrixStack matrices, int x, int y, float f) {
public void render(MatrixStack matrices, int x, int y, float f) {
super.render(matrices, x, y, f);
this.input.render(matrices, x, y);
this.output.render(matrices, x, y);
@ -54,7 +52,7 @@ public class GuiFermentingBarrel extends AAScreen<ContainerFermentingBarrel> {
}
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.press);
}

View file

@ -22,21 +22,19 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class GuiFilter extends AAScreen<ContainerFilter> {
public class GuiFilter extends GuiWtfMojang<ContainerFilter> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_filter");
public GuiFilter(ContainerFilter container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.imageWidth = 176;
this.imageHeight = 90 + 86;
}
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, StringUtil.localize("container." + ActuallyAdditions.MODID + ".filter.name"));
}

View file

@ -21,25 +21,23 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class GuiFluidCollector extends AAScreen<ContainerFluidCollector> {
public class GuiFluidCollector extends GuiWtfMojang<ContainerFluidCollector> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_fluid_collector");
private final TileEntityFluidCollector collector;
private FluidDisplay fluid;
public GuiFluidCollector(ContainerFluidCollector container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.collector = container.collector;
this.imageWidth = 176;
this.imageHeight = 93 + 86;
}
@Override
public void render(@Nonnull MatrixStack matrices, int x, int y, float f) {
public void render(MatrixStack matrices, int x, int y, float f) {
super.render(matrices, x, y, f);
this.fluid.render(matrices, x, y);
@ -52,7 +50,7 @@ public class GuiFluidCollector extends AAScreen<ContainerFluidCollector> {
}
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.collector);
}

View file

@ -24,10 +24,8 @@ import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class GuiFurnaceDouble extends AAScreen<ContainerFurnaceDouble> {
public class GuiFurnaceDouble extends GuiWtfMojang<ContainerFurnaceDouble> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_furnace_double");
private final TileEntityPoweredFurnace tileFurnace;
@ -36,14 +34,14 @@ public class GuiFurnaceDouble extends AAScreen<ContainerFurnaceDouble> {
private Button buttonAutoSplit;
public GuiFurnaceDouble(ContainerFurnaceDouble container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.tileFurnace = container.furnace;
this.imageWidth = 176;
this.imageHeight = 93 + 86;
}
@Override
public void render(@Nonnull MatrixStack matrices, int x, int y, float f) {
public void render(MatrixStack matrices, int x, int y, float f) {
super.render(matrices, x, y, f);
this.energy.render(matrices, x, y);
@ -81,7 +79,7 @@ public class GuiFurnaceDouble extends AAScreen<ContainerFurnaceDouble> {
// }
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.tileFurnace);
}

View file

@ -24,10 +24,8 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class GuiLaserRelayItemWhitelist extends AAScreen<ContainerLaserRelayItemWhitelist> {
public class GuiLaserRelayItemWhitelist extends GuiWtfMojang<ContainerLaserRelayItemWhitelist> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_laser_relay_item_whitelist");
private final TileEntityLaserRelayItemAdvanced tile;
@ -39,7 +37,7 @@ public class GuiLaserRelayItemWhitelist extends AAScreen<ContainerLaserRelayItem
private Button buttonSmartWhitelistRight;
public GuiLaserRelayItemWhitelist(ContainerLaserRelayItemWhitelist container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.tile = container.tile;
this.imageWidth = 176;
this.imageHeight = 93 + 86;
@ -72,7 +70,7 @@ public class GuiLaserRelayItemWhitelist extends AAScreen<ContainerLaserRelayItem
// }
@Override
public void render(@Nonnull MatrixStack matrices, int x, int y, float f) {
public void render(MatrixStack matrices, int x, int y, float f) {
super.render(matrices, x, y, f);
//
// if (this.buttonSmartWhitelistLeft.isMouseOver() || this.buttonSmartWhitelistRight.isMouseOver()) {
@ -87,7 +85,7 @@ public class GuiLaserRelayItemWhitelist extends AAScreen<ContainerLaserRelayItem
}
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.tile);
String s1 = StringUtil.localize("info." + ActuallyAdditions.MODID + ".gui.inbound");

View file

@ -22,17 +22,15 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class GuiMiner extends AAScreen<ContainerMiner> {
public class GuiMiner extends GuiWtfMojang<ContainerMiner> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_breaker");
private final TileEntityVerticalDigger miner;
public GuiMiner(ContainerMiner container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.miner = container.miner;
this.imageWidth = 176;
this.imageHeight = 93 + 86;
@ -52,7 +50,7 @@ public class GuiMiner extends AAScreen<ContainerMiner> {
}
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.miner);
}

View file

@ -23,11 +23,9 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class GuiOilGenerator extends AAScreen<ContainerOilGenerator> {
public class GuiOilGenerator extends GuiWtfMojang<ContainerOilGenerator> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_oil_generator");
private final TileEntityOilGenerator generator;
@ -36,7 +34,7 @@ public class GuiOilGenerator extends AAScreen<ContainerOilGenerator> {
private FluidDisplay fluid;
public GuiOilGenerator(ContainerOilGenerator container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.generator = container.generator;
this.imageWidth = 176;
this.imageHeight = 93 + 86;
@ -50,14 +48,14 @@ public class GuiOilGenerator extends AAScreen<ContainerOilGenerator> {
}
@Override
public void render(@Nonnull MatrixStack matrices, int x, int y, float f) {
public void render(MatrixStack matrices, int x, int y, float f) {
super.render(matrices, x, y, f);
this.energy.render(matrices, x, y);
this.fluid.render(matrices, x, y);
}
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.generator);
}

View file

@ -21,16 +21,14 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class GuiPhantomPlacer extends AAScreen<ContainerPhantomPlacer> {
public class GuiPhantomPlacer extends GuiWtfMojang<ContainerPhantomPlacer> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_breaker");
private final TileEntityPhantomPlacer placer;
public GuiPhantomPlacer(ContainerPhantomPlacer container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.placer = container.placer;
this.imageWidth = 176;
this.imageHeight = 93 + 86;
@ -55,7 +53,7 @@ public class GuiPhantomPlacer extends AAScreen<ContainerPhantomPlacer> {
}
@Override
public void render(@Nonnull MatrixStack matrices, int mouseX, int mouseY, float partialTicks) {
public void render(MatrixStack matrices, int mouseX, int mouseY, float partialTicks) {
super.render(matrices, mouseX, mouseY, partialTicks);
// if (!this.placer.isBreaker && this.buttonList.get(0).isMouseOver()) {
@ -80,7 +78,7 @@ public class GuiPhantomPlacer extends AAScreen<ContainerPhantomPlacer> {
// }
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.placer);
}

View file

@ -21,11 +21,9 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class GuiRangedCollector extends AAScreen<ContainerRangedCollector> {
public class GuiRangedCollector extends GuiWtfMojang<ContainerRangedCollector> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_ranged_collector");
private final TileEntityRangedCollector collector;
@ -33,7 +31,7 @@ public class GuiRangedCollector extends AAScreen<ContainerRangedCollector> {
private FilterSettingsGui filter;
public GuiRangedCollector(ContainerRangedCollector container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.collector = container.collector;
this.imageWidth = 176;
this.imageHeight = 86 + 86;
@ -47,7 +45,7 @@ public class GuiRangedCollector extends AAScreen<ContainerRangedCollector> {
}
@Override
public void render(@Nonnull MatrixStack matrices, int x, int y, float f) {
public void render(MatrixStack matrices, int x, int y, float f) {
super.render(matrices, x, y, f);
//this.filter.drawHover(matrices, x, y);
@ -61,7 +59,7 @@ public class GuiRangedCollector extends AAScreen<ContainerRangedCollector> {
}
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.collector);
}

View file

@ -14,26 +14,18 @@ import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.Container;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import javax.annotation.Nonnull;
public abstract class GuiWtfMojang<T extends Container> extends ContainerScreen<T> {
public abstract class AAScreen<T extends Container> extends ContainerScreen<T> {
public AAScreen(T container, PlayerInventory inventory, ITextComponent pTitle) {
super(container, inventory, pTitle);
public GuiWtfMojang(T inventorySlotsIn, PlayerInventory inventory) {
super(inventorySlotsIn, inventory, StringTextComponent.EMPTY);
}
@Override
public void render(@Nonnull MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
this.renderBackground(matrixStack);
super.render(matrixStack, mouseX, mouseY, partialTicks);
this.renderTooltip(matrixStack, mouseX, mouseY);
}
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
font.draw(matrices, this.title, titleLabelX, titleLabelY, 0xFFFFFF);
}
}

View file

@ -22,17 +22,15 @@ import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import javax.annotation.Nonnull;
@OnlyIn(Dist.CLIENT)
public class GuiXPSolidifier extends AAScreen<ContainerXPSolidifier> {
public class GuiXPSolidifier extends GuiWtfMojang<ContainerXPSolidifier> {
private static final ResourceLocation RES_LOC = AssetUtil.getGuiLocation("gui_xp_solidifier");
private final TileEntityXPSolidifier solidifier;
public GuiXPSolidifier(ContainerXPSolidifier container, PlayerInventory inventory, ITextComponent title) {
super(container, inventory, title);
super(container, inventory);
this.solidifier = container.solidifier;
this.imageWidth = 176;
this.imageHeight = 93 + 86;
@ -73,7 +71,7 @@ public class GuiXPSolidifier extends AAScreen<ContainerXPSolidifier> {
}
@Override
public void renderLabels(@Nonnull MatrixStack matrices, int x, int y) {
public void renderLabels(MatrixStack matrices, int x, int y) {
AssetUtil.displayNameString(matrices, this.font, this.imageWidth, -10, this.solidifier);
}

View file

@ -19,7 +19,6 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.SUpdateTileEntityPacket;
import net.minecraft.tileentity.ITickableTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.Direction;
@ -36,7 +35,7 @@ import net.minecraftforge.items.IItemHandler;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
public abstract class TileEntityBase extends TileEntity implements ITickableTileEntity {
public abstract class TileEntityBase extends TileEntity implements ITickable {
public boolean isRedstonePowered;
public boolean isPulseMode;
@ -49,6 +48,17 @@ public abstract class TileEntityBase extends TileEntity implements ITickableTile
super(type);
}
private static void register(Class<? extends TileEntityBase> tileClass) {
// TODO: [port] migrate to register system.
// try {
// //This is hacky and dirty but it works so whatever
// ResourceLocation name = new ResourceLocation(ActuallyAdditions.MODID, tileClass.newInstance().name);
// GameRegistry.registerTileEntity(tileClass, name);
// } catch (Exception e) {
// ActuallyAdditions.LOGGER.fatal("Registering a TileEntity failed!", e);
// }
}
@Override
public CompoundNBT save(CompoundNBT compound) {
this.writeSyncableNBT(compound, NBTType.SAVE_TILE);
@ -261,7 +271,7 @@ public abstract class TileEntityBase extends TileEntity implements ITickableTile
}
protected boolean sendUpdateWithInterval() {
if (this.ticksElapsed % 5 == 0) { //TODO was a config TILE_ENTITY_UPDATE_INTERVAL
if (this.ticksElapsed % ConfigIntValues.TILE_ENTITY_UPDATE_INTERVAL.getValue() == 0) {
this.sendUpdate();
return true;
} else {

View file

@ -27,10 +27,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.ForgeHooks;
@ -43,7 +41,7 @@ import javax.annotation.Nullable;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase.NBTType;
import net.minecraftforge.fml.server.ServerLifecycleHooks;
public class TileEntityCoalGenerator extends TileEntityInventoryBase implements INamedContainerProvider, ISharingEnergyProvider, IEnergyDisplay {
public class TileEntityCoalGenerator extends TileEntityInventoryBase implements INamedContainerProvider, ISharingEnergyProvider {
public final CustomEnergyStorage storage = new CustomEnergyStorage(60000, 0, 80);
public final LazyOptional<IEnergyStorage> lazyEnergy = LazyOptional.of(() -> this.storage);
@ -74,8 +72,6 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
if (type != NBTType.SAVE_BLOCK) {
compound.putInt("BurnTime", this.currentBurnTime);
compound.putInt("MaxBurnTime", this.maxBurnTime);
if (currentRecipe != null)
compound.putString("currentRecipe", currentRecipe.getId().toString());
}
this.storage.writeToNBT(compound);
super.writeSyncableNBT(compound, type);
@ -86,15 +82,6 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
if (type != NBTType.SAVE_BLOCK) {
this.currentBurnTime = compound.getInt("BurnTime");
this.maxBurnTime = compound.getInt("MaxBurnTime");
if (compound.contains("currentRecipe")) {
ResourceLocation id = new ResourceLocation(compound.getString("currentRecipe"));
for (SolidFuelRecipe fuelRecipe : ActuallyAdditionsAPI.SOLID_FUEL_RECIPES) {
if (fuelRecipe.getId().equals(id)) {
this.currentRecipe = fuelRecipe;
break;
}
}
}
}
this.storage.readFromNBT(compound);
super.readSyncableNBT(compound, type);
@ -150,13 +137,7 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
@Override
public IAcceptor getAcceptor() {
return (slot, stack, automation) -> {
SingleItem singleItem = new SingleItem(stack);
for (SolidFuelRecipe recipe : ActuallyAdditionsAPI.SOLID_FUEL_RECIPES) {
if (recipe.matches(singleItem, null))return true;
}
return false;
};
return (slot, stack, automation) -> ForgeHooks.getBurnTime(stack) > 0;
}
@Override
@ -196,7 +177,7 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
@Override
public ITextComponent getDisplayName() {
return new TranslationTextComponent("container.actuallyadditions.coalGenerator");
return StringTextComponent.EMPTY;
}
@Nullable
@ -204,14 +185,4 @@ public class TileEntityCoalGenerator extends TileEntityInventoryBase implements
public Container createMenu(int windowId, PlayerInventory playerInventory, PlayerEntity player) {
return new ContainerCoalGenerator(windowId, playerInventory, this);
}
@Override
public CustomEnergyStorage getEnergyStorage() {
return storage;
}
@Override
public boolean needsHoldShift() {
return false;
}
}

View file

@ -4,9 +4,9 @@
"achievement.page.actuallyadditions": "Actually Additions",
"actuallyadditions.lolWutHowUDoDis": "This is bugged. Throw it away. Please.",
"tooltip.actuallyadditions.disabled": "Disabled Object",
"actuallyadditions.fet": "FE/t",
"actuallyadditions.fe": "FE",
"actuallyadditions.felong": "Forge Energy",
"actuallyadditions.cft": "CF/t",
"actuallyadditions.cf": "CF",
"actuallyadditions.cflong": "Crystal Flux",
"misc.actuallyadditions.power_long": "%s/%s Crystal Flux",
"misc.actuallyadditions.power_single": "%s Crystal Flux",
"misc.actuallyadditions.power_single_short": "%s CF",