From 32f7a3915f3b2f0c76aa9628ec38d31eeda9b5ae Mon Sep 17 00:00:00 2001 From: Michael Hillcox Date: Sat, 27 Feb 2021 16:22:03 +0000 Subject: [PATCH] chore: blocks & micro porting --- .../mod/blocks/BlockAtomicReconstructor.java | 181 ++- .../mod/blocks/BlockBatteryBox.java | 46 +- .../mod/blocks/BlockCompost.java | 4 +- .../mod/blocks/BlockLaserRelay.java | 4 +- .../blocks/BlockLavaFactoryController.java | 4 +- .../mod/blocks/BlockMiner.java | 4 +- .../mod/blocks/BlockPhantom.java | 4 +- .../mod/blocks/BlockPlayerInterface.java | 4 +- .../mod/blocks/IHudDisplay.java | 8 +- .../mod/blocks/base/BlockContainerBase.java | 26 +- .../mod/blocks/render/RenderSmileyCloud.java | 207 ++-- .../mod/booklet/InitBooklet.java | 160 ++- .../mod/event/ClientEvents.java | 82 +- .../actuallyadditions/mod/fluids/FluidAA.java | 2 +- .../mod/fluids/InitFluids.java | 23 +- .../mod/inventory/ContainerBag.java | 18 +- .../mod/items/ItemBooklet.java | 4 +- .../mod/jei/RecipeWrapperWithButton.java | 3 +- .../mod/misc/DamageSources.java | 8 +- .../mod/misc/cloud/ISmileyCloudEasterEgg.java | 49 +- .../mod/misc/cloud/SmileyCloudEasterEggs.java | 1047 +++++++++-------- .../mod/misc/special/RenderSpecial.java | 5 +- .../actuallyadditions/mod/util/Help.java | 15 + 23 files changed, 921 insertions(+), 987 deletions(-) create mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/util/Help.java diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java index b91f068c7..a4d84e24b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockAtomicReconstructor.java @@ -13,64 +13,58 @@ package de.ellpeck.actuallyadditions.mod.blocks; import de.ellpeck.actuallyadditions.api.lens.ILensItem; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; -import de.ellpeck.actuallyadditions.mod.blocks.base.ItemBlockBase; import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues; import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.Block; -import net.minecraft.block.BlockDirectional; +import net.minecraft.block.BlockState; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; -import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.client.MainWindow; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.client.util.ITooltipFlag; -import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.init.Items; -import net.minecraft.item.EnumRarity; +import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.state.DirectionProperty; +import net.minecraft.state.StateContainer; +import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.Hand; -import net.minecraft.util.Mirror; -import net.minecraft.util.Rotation; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.RayTraceResult; import net.minecraft.util.text.TextFormatting; +import net.minecraft.world.IBlockReader; import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.fml.relauncher.OnlyIn; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.common.ToolType; -import java.util.List; +import javax.annotation.Nullable; public class BlockAtomicReconstructor extends BlockContainerBase implements IHudDisplay { + public static final DirectionProperty FACING = BlockStateProperties.FACING; public static final int NAME_FLAVOR_AMOUNTS_1 = 12; public static final int NAME_FLAVOR_AMOUNTS_2 = 14; public BlockAtomicReconstructor() { - super(Material.ROCK, this.name); - this.setHarvestLevel("pickaxe", 0); - this.setHardness(10F); - this.setResistance(80F); - this.setSoundType(SoundType.STONE); + super(Properties.create(Material.ROCK).harvestTool(ToolType.PICKAXE).hardnessAndResistance(10F, 80F).sound(SoundType.STONE)); + this.setDefaultState(this.stateContainer.getBaseState().with(FACING, Direction.NORTH)); } @Override - public boolean isOpaqueCube(BlockState state) { - return false; - } - - @Override - public boolean onBlockActivated(World world, BlockPos pos, BlockState state, PlayerEntity player, Hand hand, Direction par6, float par7, float par8, float par9) { + public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) { ItemStack heldItem = player.getHeldItem(hand); if (this.tryToggleRedstone(world, pos, player)) { - return true; + return ActionResultType.PASS; } if (!world.isRemote) { TileEntityAtomicReconstructor reconstructor = (TileEntityAtomicReconstructor) world.getTileEntity(pos); @@ -84,7 +78,7 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud player.inventory.decrStackSize(player.inventory.currentItem, 1); } //Shush, don't tell anyone! - else if (ConfigIntValues.ELEVEN.getValue() == 11 && item == Items.RECORD_11) { + else if (ConfigIntValues.ELEVEN.getValue() == 11 && item == Items.MUSIC_DISC_11) { reconstructor.counter++; reconstructor.markDirty(); } @@ -97,17 +91,32 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud } } } - return true; + return ActionResultType.PASS; + } + + @Nullable + @Override + public TileEntity createNewTileEntity(IBlockReader worldIn) { + return new TileEntityAtomicReconstructor(); + } + + public BlockState getBaseConstructorState() { + return this.stateContainer.getBaseState().with(FACING, Direction.NORTH); } @Override - public TileEntity createNewTileEntity(World world, int i) { - return new TileEntityAtomicReconstructor(); + public BlockState getStateForPlacement(BlockItemUseContext context) { + return this.getDefaultState().with(FACING, context.getNearestLookingDirection().getOpposite()); + } + + @Override + protected void fillStateContainer(StateContainer.Builder builder) { + builder.add(FACING); } @Override @OnlyIn(Dist.CLIENT) - public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution) { + public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, MainWindow resolution) { TileEntity tile = minecraft.world.getTileEntity(posHit.getBlockPos()); if (tile instanceof TileEntityAtomicReconstructor) { ItemStack slot = ((TileEntityAtomicReconstructor) tile).inv.getStackInSlot(0); @@ -123,87 +132,43 @@ public class BlockAtomicReconstructor extends BlockContainerBase implements IHud } } - @Override - protected ItemBlockBase getItemBlock() { - return new TheItemBlock(this); - } - @Override - public EnumRarity getRarity(ItemStack stack) { - return EnumRarity.EPIC; - } + // @Override + // public BlockState withRotation(BlockState state, Rotation rot) { + // return state.withProperty(BlockDirectional.FACING, rot.rotate(state.getValue(BlockDirectional.FACING))); + // } + // + // @Override + // public BlockState withMirror(BlockState state, Mirror mirror) { + // return this.withRotation(state, mirror.toRotation(state.getValue(BlockDirectional.FACING))); + // } - @Override - public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, EntityLivingBase player, ItemStack stack) { - int rotation = Direction.getDirectionFromEntityLiving(pos, player).ordinal(); - world.setBlockState(pos, this.getStateFromMeta(rotation), 2); - - super.onBlockPlacedBy(world, pos, state, player, stack); - } - - @Override - public BlockState getStateFromMeta(int meta) { - return this.getDefaultState().withProperty(BlockDirectional.FACING, Direction.byIndex(meta)); - } - - @Override - public int getMetaFromState(BlockState state) { - return state.getValue(BlockDirectional.FACING).getIndex(); - } - - @Override - protected BlockStateContainer createBlockState() { - return new BlockStateContainer(this, BlockDirectional.FACING); - } - - @Override - public BlockState withRotation(BlockState state, Rotation rot) { - return state.withProperty(BlockDirectional.FACING, rot.rotate(state.getValue(BlockDirectional.FACING))); - } - - @Override - public BlockState withMirror(BlockState state, Mirror mirror) { - return this.withRotation(state, mirror.toRotation(state.getValue(BlockDirectional.FACING))); - } - - public static class TheItemBlock extends ItemBlockBase { - - private long lastSysTime; - private int toPick1; - private int toPick2; - - public TheItemBlock(Block block) { - super(block); - this.setHasSubtypes(false); - this.setMaxDamage(0); - } - - @Override - public String getTranslationKey(ItemStack stack) { - return this.getTranslationKey(); - } - - @Override - public int getMetadata(int damage) { - return damage; - } - - @Override - public void addInformation(ItemStack stack, World world, List tooltip, ITooltipFlag advanced) { - long sysTime = System.currentTimeMillis(); - - if (this.lastSysTime + 3000 < sysTime) { - this.lastSysTime = sysTime; - if (world != null) { - this.toPick1 = world.rand.nextInt(NAME_FLAVOR_AMOUNTS_1) + 1; - this.toPick2 = world.rand.nextInt(NAME_FLAVOR_AMOUNTS_2) + 1; - } - } - - String base = "tile." + ActuallyAdditions.MODID + "." + ((BlockAtomicReconstructor) this.block).getBaseName() + ".info."; - tooltip.add(StringUtil.localize(base + "1." + this.toPick1) + " " + StringUtil.localize(base + "2." + this.toPick2)); - } - } + // public static class TheItemBlock extends ItemBlockBase { + // + // private long lastSysTime; + // private int toPick1; + // private int toPick2; + // + // public TheItemBlock(Block block) { + // super(block, new Item.Properties().group(ActuallyAdditions.GROUP).setNoRepair()); + // } + // + // @Override + // public void addInformation(ItemStack stack, @Nullable World worldIn, List tooltip, ITooltipFlag flagIn) { + // long sysTime = System.currentTimeMillis(); + // + // if (this.lastSysTime + 3000 < sysTime) { + // this.lastSysTime = sysTime; + // if (Minecraft.getInstance().world != null) { + // this.toPick1 = Minecraft.getInstance().world.rand.nextInt(NAME_FLAVOR_AMOUNTS_1) + 1; + // this.toPick2 = Minecraft.getInstance().world.rand.nextInt(NAME_FLAVOR_AMOUNTS_2) + 1; + // } + // } + // + // String base = "tile." + ActuallyAdditions.MODID + "." + ((BlockAtomicReconstructor) this.block).getBaseName() + ".info."; + // tooltip.add(StringUtil.localize(base + "1." + this.toPick1) + " " + StringUtil.localize(base + "2." + this.toPick2)); + // } + // } @Override public boolean hasComparatorInputOverride(BlockState state) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBatteryBox.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBatteryBox.java index c361fde4f..dcf4025b2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBatteryBox.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockBatteryBox.java @@ -14,41 +14,41 @@ import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; import de.ellpeck.actuallyadditions.mod.items.ItemBattery; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBatteryBox; import de.ellpeck.actuallyadditions.mod.util.StackUtil; +import net.minecraft.block.BlockState; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Direction; +import net.minecraft.util.ActionResultType; import net.minecraft.util.Hand; -import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; +import net.minecraft.util.math.BlockRayTraceResult; +import net.minecraft.world.IBlockReader; import net.minecraft.world.World; +import net.minecraftforge.common.ToolType; + +import javax.annotation.Nullable; public class BlockBatteryBox extends BlockContainerBase { public BlockBatteryBox() { - super(Material.ROCK, this.name); - this.setHarvestLevel("pickaxe", 0); - this.setHardness(1.5F); - this.setResistance(10.0F); - this.setSoundType(SoundType.STONE); + super(Properties.create(Material.ROCK).harvestTool(ToolType.PICKAXE).hardnessAndResistance(1.5f, 10.0f).sound(SoundType.STONE)); } - @Override - public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) { - return BlockSlabs.AABB_BOTTOM_HALF; - } + // @Override + // public AxisAlignedBB getBoundingBox(BlockState state, IBlockAccess source, BlockPos pos) { + // return BlockSlabs.AABB_BOTTOM_HALF; + // } + @Nullable @Override - public TileEntity createNewTileEntity(World world, int meta) { + public TileEntity createNewTileEntity(IBlockReader worldIn) { return new TileEntityBatteryBox(); } @Override - public boolean onBlockActivated(World world, BlockPos pos, BlockState state, PlayerEntity player, Hand hand, Direction facing, float hitX, float hitY, float hitZ) { + public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) { TileEntity tile = world.getTileEntity(pos); if (tile instanceof TileEntityBatteryBox) { TileEntityBatteryBox box = (TileEntityBatteryBox) tile; @@ -58,27 +58,17 @@ public class BlockBatteryBox extends BlockContainerBase { if (stack.getItem() instanceof ItemBattery && !StackUtil.isValid(box.inv.getStackInSlot(0))) { box.inv.setStackInSlot(0, stack.copy()); player.setHeldItem(hand, StackUtil.getEmpty()); - return true; + return ActionResultType.SUCCESS; } } else { ItemStack inSlot = box.inv.getStackInSlot(0); if (StackUtil.isValid(inSlot)) { player.setHeldItem(hand, inSlot.copy()); box.inv.setStackInSlot(0, StackUtil.getEmpty()); - return true; + return ActionResultType.SUCCESS; } } } - return false; - } - - @Override - public boolean isOpaqueCube(BlockState state) { - return false; - } - - @Override - public EnumRarity getRarity(ItemStack stack) { - return EnumRarity.RARE; + return ActionResultType.PASS; } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java index a5732d5e8..8e16eed73 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockCompost.java @@ -21,8 +21,8 @@ import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.client.MainWindow; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.EnumRarity; @@ -157,7 +157,7 @@ public class BlockCompost extends BlockContainerBase implements IHudDisplay { @Override @OnlyIn(Dist.CLIENT) - public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution) { + public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, MainWindow resolution) { TileEntity tile = minecraft.world.getTileEntity(posHit.getBlockPos()); if (tile instanceof TileEntityCompost) { ItemStack slot = ((TileEntityCompost) tile).inv.getStackInSlot(0); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java index 9c81d7649..004637240 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java @@ -27,8 +27,8 @@ import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.BlockFaceShape; import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.client.MainWindow; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.EnumRarity; @@ -244,7 +244,7 @@ public class BlockLaserRelay extends BlockContainerBase implements IHudDisplay { @Override @OnlyIn(Dist.CLIENT) - public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution) { + public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, MainWindow resolution) { if (posHit != null && posHit.getBlockPos() != null && minecraft.world != null) { boolean wearing = ItemEngineerGoggles.isWearing(player); if (wearing || StackUtil.isValid(stack)) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLavaFactoryController.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLavaFactoryController.java index db5584562..5a0997760 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLavaFactoryController.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLavaFactoryController.java @@ -16,8 +16,8 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityLavaFactoryController; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.client.MainWindow; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; @@ -49,7 +49,7 @@ public class BlockLavaFactoryController extends BlockContainerBase implements IH @Override @OnlyIn(Dist.CLIENT) - public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution) { + public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, MainWindow resolution) { TileEntityLavaFactoryController factory = (TileEntityLavaFactoryController) minecraft.world.getTileEntity(posHit.getBlockPos()); if (factory != null) { int state = factory.isMultiblock(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMiner.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMiner.java index 96a822408..bdf38167a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMiner.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockMiner.java @@ -17,8 +17,8 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityMiner; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.client.MainWindow; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; @@ -69,7 +69,7 @@ public class BlockMiner extends BlockContainerBase implements IHudDisplay { @Override @OnlyIn(Dist.CLIENT) - public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution) { + public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, MainWindow resolution) { TileEntity tile = minecraft.world.getTileEntity(posHit.getBlockPos()); if (tile instanceof TileEntityMiner) { TileEntityMiner miner = (TileEntityMiner) tile; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java index 00671db96..c1c502e99 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPhantom.java @@ -18,8 +18,8 @@ import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.Block; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.client.MainWindow; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.EnumRarity; import net.minecraft.item.Item; @@ -121,7 +121,7 @@ public class BlockPhantom extends BlockContainerBase implements IHudDisplay { @Override @OnlyIn(Dist.CLIENT) - public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution) { + public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, MainWindow resolution) { TileEntity tile = minecraft.world.getTileEntity(posHit.getBlockPos()); if (tile != null) { if (tile instanceof IPhantomTile) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPlayerInterface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPlayerInterface.java index 470854577..1ebbb1ed2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPlayerInterface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockPlayerInterface.java @@ -15,8 +15,8 @@ import de.ellpeck.actuallyadditions.mod.tile.TileEntityPlayerInterface; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.client.MainWindow; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.EnumRarity; @@ -67,7 +67,7 @@ public class BlockPlayerInterface extends BlockContainerBase implements IHudDisp @Override @OnlyIn(Dist.CLIENT) - public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution) { + public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, MainWindow resolution) { TileEntity tile = minecraft.world.getTileEntity(posHit.getBlockPos()); if (tile != null) { if (tile instanceof TileEntityPlayerInterface) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/IHudDisplay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/IHudDisplay.java index f1e2863cf..41a154450 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/IHudDisplay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/IHudDisplay.java @@ -10,17 +10,17 @@ package de.ellpeck.actuallyadditions.mod.blocks; +import net.minecraft.client.MainWindow; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.util.math.RayTraceResult; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.OnlyIn; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; public interface IHudDisplay { @OnlyIn(Dist.CLIENT) - void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution); + void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, MainWindow resolution); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java index e8a435d2a..787b4a9f3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/base/BlockContainerBase.java @@ -14,7 +14,6 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.config.ConfigValues; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityInventoryBase; -import de.ellpeck.actuallyadditions.mod.util.ItemUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockState; @@ -23,7 +22,6 @@ import net.minecraft.entity.LivingEntity; import net.minecraft.entity.item.ItemEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.fluid.FluidState; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntity; @@ -41,30 +39,8 @@ import javax.annotation.Nullable; import java.util.Random; public abstract class BlockContainerBase extends ContainerBlock { - - private final String name; - - public BlockContainerBase(Properties properties, String name) { + public BlockContainerBase(Properties properties) { super(properties); - this.name = name; - - this.register(); - } - - private void register() { - ItemUtil.registerBlock(this, this.getItemBlock(), this.getBaseName(), this.shouldAddCreative()); - } - - protected String getBaseName() { - return this.name; - } - - protected ItemBlockBase getItemBlock() { - return new ItemBlockBase(this, new Item.Properties().group(ActuallyAdditions.GROUP)); - } - - public boolean shouldAddCreative() { - return true; } private void dropInventory(World world, BlockPos position) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderSmileyCloud.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderSmileyCloud.java index e2c067259..5ae753a7b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderSmileyCloud.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/render/RenderSmileyCloud.java @@ -1,103 +1,104 @@ -/* - * This file ("RenderSmileyCloud.java") is part of the Actually Additions mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2015-2017 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.blocks.render; - -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.misc.cloud.ISmileyCloudEasterEgg; -import de.ellpeck.actuallyadditions.mod.misc.cloud.SmileyCloudEasterEggs; -import de.ellpeck.actuallyadditions.mod.misc.special.RenderSpecial; -import de.ellpeck.actuallyadditions.mod.misc.special.SpecialRenderInit; -import de.ellpeck.actuallyadditions.mod.tile.TileEntitySmileyCloud; -import de.ellpeck.actuallyadditions.mod.util.AssetUtil; -import net.minecraft.block.BlockHorizontal; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.fml.relauncher.OnlyIn; - -import java.util.Locale; - -@OnlyIn(Dist.CLIENT) -public class RenderSmileyCloud extends TileEntitySpecialRenderer { - - @Override - public void render(TileEntitySmileyCloud theCloud, double x, double y, double z, float par5, int partial, float f) { - if (theCloud instanceof TileEntitySmileyCloud) { - - GlStateManager.pushMatrix(); - GlStateManager.translate((float) x + 0.5F, (float) y - 0.5F, (float) z + 0.5F); - GlStateManager.rotate(180F, 0.0F, 0.0F, 1.0F); - GlStateManager.translate(0.0F, -2F, 0.0F); - - if (theCloud.name != null && !theCloud.name.isEmpty()) { - boolean renderedEaster = false; - - easterEggs: - for (ISmileyCloudEasterEgg cloud : SmileyCloudEasterEggs.CLOUD_STUFF) { - for (String triggerName : cloud.getTriggerNames()) { - if (triggerName != null && theCloud.name != null) { - if (triggerName.equalsIgnoreCase(theCloud.name)) { - GlStateManager.pushMatrix(); - - BlockState state = theCloud.getWorld().getBlockState(theCloud.getPos()); - if (state.getBlock() == InitBlocks.blockSmileyCloud) { - switch (state.getValue(BlockHorizontal.FACING)) { - case NORTH: - GlStateManager.rotate(180, 0, 1, 0); - break; - case EAST: - GlStateManager.rotate(270, 0, 1, 0); - break; - case WEST: - GlStateManager.rotate(90, 0, 1, 0); - break; - default: - break; - } - } - - cloud.renderExtra(0.0625F); - GlStateManager.popMatrix(); - - renderedEaster = true; - break easterEggs; - } - } - } - } - - String nameLower = theCloud.name.toLowerCase(Locale.ROOT); - if (SpecialRenderInit.SPECIAL_LIST.containsKey(nameLower)) { - RenderSpecial render = SpecialRenderInit.SPECIAL_LIST.get(nameLower); - if (render != null) { - GlStateManager.pushMatrix(); - GlStateManager.translate(0F, renderedEaster - ? 0.05F - : 0.25F, 0F); - GlStateManager.rotate(180F, 1.0F, 0.0F, 1.0F); - GlStateManager.scale(0.75F, 0.75F, 0.75F); - render.render(); - GlStateManager.popMatrix(); - } - } - } - GlStateManager.popMatrix(); - - Minecraft mc = Minecraft.getInstance(); - if (theCloud.name != null && !theCloud.name.isEmpty() && !mc.gameSettings.hideGUI) { - if (mc.player.getDistanceSq(theCloud.getPos()) <= 36) { - AssetUtil.renderNameTag(theCloud.name, x + 0.5F, y + 1.5F, z + 0.5F); - } - } - } - } -} +// TODO: [port] not used +///* +// * This file ("RenderSmileyCloud.java") is part of the Actually Additions mod for Minecraft. +// * It is created and owned by Ellpeck and distributed +// * under the Actually Additions License to be found at +// * http://ellpeck.de/actaddlicense +// * View the source code at https://github.com/Ellpeck/ActuallyAdditions +// * +// * © 2015-2017 Ellpeck +// */ +// +//package de.ellpeck.actuallyadditions.mod.blocks.render; +// +//import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +//import de.ellpeck.actuallyadditions.mod.misc.cloud.ISmileyCloudEasterEgg; +//import de.ellpeck.actuallyadditions.mod.misc.cloud.SmileyCloudEasterEggs; +//import de.ellpeck.actuallyadditions.mod.misc.special.RenderSpecial; +//import de.ellpeck.actuallyadditions.mod.misc.special.SpecialRenderInit; +//import de.ellpeck.actuallyadditions.mod.tile.TileEntitySmileyCloud; +//import de.ellpeck.actuallyadditions.mod.util.AssetUtil; +//import net.minecraft.block.BlockHorizontal; +//import net.minecraft.client.Minecraft; +//import net.minecraft.client.renderer.GlStateManager; +//import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +//import net.minecraftforge.api.distmarker.Dist; +//import net.minecraftforge.fml.relauncher.OnlyIn; +// +//import java.util.Locale; +// +//@OnlyIn(Dist.CLIENT) +//public class RenderSmileyCloud extends TileEntitySpecialRenderer { +// +// @Override +// public void render(TileEntitySmileyCloud theCloud, double x, double y, double z, float par5, int partial, float f) { +// if (theCloud instanceof TileEntitySmileyCloud) { +// +// GlStateManager.pushMatrix(); +// GlStateManager.translate((float) x + 0.5F, (float) y - 0.5F, (float) z + 0.5F); +// GlStateManager.rotate(180F, 0.0F, 0.0F, 1.0F); +// GlStateManager.translate(0.0F, -2F, 0.0F); +// +// if (theCloud.name != null && !theCloud.name.isEmpty()) { +// boolean renderedEaster = false; +// +// easterEggs: +// for (ISmileyCloudEasterEgg cloud : SmileyCloudEasterEggs.CLOUD_STUFF) { +// for (String triggerName : cloud.getTriggerNames()) { +// if (triggerName != null && theCloud.name != null) { +// if (triggerName.equalsIgnoreCase(theCloud.name)) { +// GlStateManager.pushMatrix(); +// +// BlockState state = theCloud.getWorld().getBlockState(theCloud.getPos()); +// if (state.getBlock() == InitBlocks.blockSmileyCloud) { +// switch (state.getValue(BlockHorizontal.FACING)) { +// case NORTH: +// GlStateManager.rotate(180, 0, 1, 0); +// break; +// case EAST: +// GlStateManager.rotate(270, 0, 1, 0); +// break; +// case WEST: +// GlStateManager.rotate(90, 0, 1, 0); +// break; +// default: +// break; +// } +// } +// +// cloud.renderExtra(0.0625F); +// GlStateManager.popMatrix(); +// +// renderedEaster = true; +// break easterEggs; +// } +// } +// } +// } +// +// String nameLower = theCloud.name.toLowerCase(Locale.ROOT); +// if (SpecialRenderInit.SPECIAL_LIST.containsKey(nameLower)) { +// RenderSpecial render = SpecialRenderInit.SPECIAL_LIST.get(nameLower); +// if (render != null) { +// GlStateManager.pushMatrix(); +// GlStateManager.translate(0F, renderedEaster +// ? 0.05F +// : 0.25F, 0F); +// GlStateManager.rotate(180F, 1.0F, 0.0F, 1.0F); +// GlStateManager.scale(0.75F, 0.75F, 0.75F); +// render.render(); +// GlStateManager.popMatrix(); +// } +// } +// } +// GlStateManager.popMatrix(); +// +// Minecraft mc = Minecraft.getInstance(); +// if (theCloud.name != null && !theCloud.name.isEmpty() && !mc.gameSettings.hideGUI) { +// if (mc.player.getDistanceSq(theCloud.getPos()) <= 36) { +// AssetUtil.renderNameTag(theCloud.name, x + 0.5F, y + 1.5F, z + 0.5F); +// } +// } +// } +// } +//} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java index 4e3482b87..717d33a6e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/booklet/InitBooklet.java @@ -10,11 +10,6 @@ package de.ellpeck.actuallyadditions.mod.booklet; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - import de.ellpeck.actuallyadditions.api.ActuallyAdditionsAPI; import de.ellpeck.actuallyadditions.api.booklet.IBookletChapter; import de.ellpeck.actuallyadditions.api.booklet.IBookletEntry; @@ -31,22 +26,9 @@ import de.ellpeck.actuallyadditions.mod.booklet.chapter.BookletChapterTrials; import de.ellpeck.actuallyadditions.mod.booklet.entry.BookletEntry; import de.ellpeck.actuallyadditions.mod.booklet.entry.BookletEntryAllItems; import de.ellpeck.actuallyadditions.mod.booklet.entry.BookletEntryTrials; -import de.ellpeck.actuallyadditions.mod.booklet.page.BookletPage; -import de.ellpeck.actuallyadditions.mod.booklet.page.PageCrafting; -import de.ellpeck.actuallyadditions.mod.booklet.page.PageCrusherRecipe; -import de.ellpeck.actuallyadditions.mod.booklet.page.PageEmpowerer; -import de.ellpeck.actuallyadditions.mod.booklet.page.PageFurnace; -import de.ellpeck.actuallyadditions.mod.booklet.page.PageLinkButton; -import de.ellpeck.actuallyadditions.mod.booklet.page.PagePicture; -import de.ellpeck.actuallyadditions.mod.booklet.page.PageReconstructor; -import de.ellpeck.actuallyadditions.mod.booklet.page.PageTextOnly; +import de.ellpeck.actuallyadditions.mod.booklet.page.*; import de.ellpeck.actuallyadditions.mod.config.values.ConfigIntValues; -import de.ellpeck.actuallyadditions.mod.crafting.BlockCrafting; -import de.ellpeck.actuallyadditions.mod.crafting.CrusherCrafting; -import de.ellpeck.actuallyadditions.mod.crafting.FoodCrafting; -import de.ellpeck.actuallyadditions.mod.crafting.ItemCrafting; -import de.ellpeck.actuallyadditions.mod.crafting.MiscCrafting; -import de.ellpeck.actuallyadditions.mod.crafting.ToolCrafting; +import de.ellpeck.actuallyadditions.mod.crafting.*; import de.ellpeck.actuallyadditions.mod.fluids.InitFluids; import de.ellpeck.actuallyadditions.mod.gen.AAWorldGen; import de.ellpeck.actuallyadditions.mod.gen.WorldGenLushCaves; @@ -58,37 +40,23 @@ import de.ellpeck.actuallyadditions.mod.items.metalists.TheCrystals; import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods; import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; import de.ellpeck.actuallyadditions.mod.recipe.EmpowererHandler; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityAtomicReconstructor; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityCoffeeMachine; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityDirectionalBreaker; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityFireworkBox; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceDouble; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityFurnaceSolar; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityGrinder; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityHeatCollector; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemRepairer; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelay; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayEnergy; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayEnergyAdvanced; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityLaserRelayEnergyExtreme; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityLavaFactoryController; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityMiner; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomPlacer; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityPhantomface; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityPlayerInterface; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityRangedCollector; -import de.ellpeck.actuallyadditions.mod.tile.TileEntityShockSuppressor; +import de.ellpeck.actuallyadditions.mod.tile.*; import de.ellpeck.actuallyadditions.mod.update.UpdateChecker; import de.ellpeck.actuallyadditions.mod.util.Util; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; +import net.minecraft.block.Blocks; +import net.minecraft.fluid.Fluid; import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.Ingredient; -import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidUtil; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + public final class InitBooklet { public static BookletChapter[] chaptersIntroduction = new BookletChapter[11]; @@ -172,8 +140,8 @@ public final class InitBooklet { crystalPages.add(new PageCrafting(crystalPages.size() + 1, MiscCrafting.RECIPES_CRYSTALS).setNoText()); crystalPages.add(new PageCrafting(crystalPages.size() + 1, MiscCrafting.RECIPES_CRYSTAL_BLOCKS).setNoText()); chaptersIntroduction[2] = new BookletChapter("engineerHouse", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(Items.EMERALD), new PageTextOnly(1), new PagePicture(2, "page_engineer_house", 145)); - chaptersIntroduction[6] = new BookletChapter("crystals", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockAtomicReconstructor), crystalPages.toArray(new BookletPage[crystalPages.size()])).setSpecial(); - chaptersIntroduction[5] = new BookletChapter("coalGen", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockCoalGenerator), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.COAL_GENERATOR_CF_PRODUCTION.getValue()), new PageCrafting(2, BlockCrafting.recipeCoalGen).setWildcard().setNoText()); + chaptersIntroduction[6] = new BookletChapter("crystals", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockAtomicReconstructor.get()), crystalPages.toArray(new BookletPage[crystalPages.size()])).setSpecial(); + chaptersIntroduction[5] = new BookletChapter("coalGen", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockCoalGenerator.get()), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.COAL_GENERATOR_CF_PRODUCTION.getValue()), new PageCrafting(2, BlockCrafting.recipeCoalGen).setWildcard().setNoText()); ArrayList empowererPages = new ArrayList<>(); empowererPages.addAll(Arrays.asList(new PageTextOnly(1), new PagePicture(2, "page_empowerer", 137), new PageCrafting(3, BlockCrafting.recipeEmpowerer), new PageCrafting(4, BlockCrafting.recipeDisplayStand))); for (int i = 0; i < EmpowererHandler.MAIN_PAGE_RECIPES.size(); i++) { @@ -181,7 +149,7 @@ public final class InitBooklet { } empowererPages.add(new PageCrafting(empowererPages.size() + 1, MiscCrafting.RECIPES_EMPOWERED_CRYSTALS).setNoText()); empowererPages.add(new PageCrafting(empowererPages.size() + 1, MiscCrafting.RECIPES_EMPOWERED_CRYSTAL_BLOCKS).setNoText()); - new BookletChapter("empowerer", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockEmpowerer), empowererPages.toArray(new BookletPage[empowererPages.size()])).setSpecial(); + new BookletChapter("empowerer", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitBlocks.blockEmpowerer.get()), empowererPages.toArray(new BookletPage[empowererPages.size()])).setSpecial(); new BookletChapter("craftingIngs", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeCoil).setNoText(), new PageCrafting(3, ItemCrafting.recipeCoilAdvanced).setNoText(), new PageCrafting(4, BlockCrafting.recipeCase).setNoText(), new PageCrafting(5, BlockCrafting.recipeEnderPearlBlock).setNoText(), new PageCrafting(6, BlockCrafting.recipeEnderCase).setNoText(), new PageCrafting(7, ItemCrafting.recipeRing).setNoText(), new PageCrafting(8, ItemCrafting.recipeKnifeHandle).setNoText(), new PageCrafting(9, ItemCrafting.recipeKnifeBlade).setNoText(), new PageCrafting(10, ItemCrafting.recipeKnife).setNoText(), new PageCrafting(11, ItemCrafting.recipeDough).setNoText(), new PageCrafting(12, ItemCrafting.recipeRiceDough).setNoText(), new PageCrafting(13, BlockCrafting.recipeIronCase).setNoText(), new PageCrafting(14, ItemCrafting.recipeLens).setNoText()); chaptersIntroduction[4] = new BookletChapter("rf", ActuallyAdditionsAPI.entryGettingStarted, new ItemStack(Items.REDSTONE), new PageTextOnly(1), new PageTextOnly(2)).setImportant(); @@ -189,7 +157,7 @@ public final class InitBooklet { new BookletChapter("worms", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemWorm), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemWorm)), new PagePicture(2, "page_worms", 145)).setImportant(); new BookletChapter("lushCaves", ActuallyAdditionsAPI.entryMisc, new ItemStack(Blocks.STONE), new PageTextOnly(1), new PagePicture(2, "page_lush_caves", 0).setNoText()); new BookletChapter("crystalClusters", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockCrystalClusterEmerald), new PageTextOnly(1).addItemsToPage(WorldGenLushCaves.CRYSTAL_CLUSTERS), new PageCrafting(2, MiscCrafting.RECIPES_CRYSTAL_SHARDS).setNoText(), new PageCrafting(3, MiscCrafting.RECIPES_CRYSTAL_SHARDS_BACK).setNoText()).setSpecial(); - new BookletChapter("banners", ActuallyAdditionsAPI.entryMisc, new ItemStack(Items.BANNER, 1, 15), new PageTextOnly(1)); + new BookletChapter("banners", ActuallyAdditionsAPI.entryMisc, new ItemStack(Items.BLUE_BANNER, 1), new PageTextOnly(1)); new BookletChapter("miscDecorStuffsAndThings", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockTestifiBucksGreenWall), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeWhiteWall).setNoText(), new PageReconstructor(3, LensRecipeHandler.recipeGreenWall).setNoText()); chaptersIntroduction[3] = new BookletChapter("quartz", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal())).addTextReplacement("", AAWorldGen.QUARTZ_MIN).addTextReplacement("", AAWorldGen.QUARTZ_MAX), new PageTextOnly(2).addItemsToPage(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())), new PageCrafting(3, BlockCrafting.recipeQuartzBlock).setNoText(), new PageCrafting(4, BlockCrafting.recipeQuartzPillar).setNoText(), new PageCrafting(5, BlockCrafting.recipeQuartzChiseled).setNoText()); new BookletChapter("cloud", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockSmileyCloud), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeSmileyCloud).setWildcard()).setSpecial(); @@ -201,14 +169,14 @@ public final class InitBooklet { for (IRecipe recipe : BlockCrafting.RECIPES_LAMPS) { lampPages.add(new PageCrafting(lampPages.size() + 1, recipe).setNoText()); } - new BookletChapter("lamps", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockColoredLampOn, 1, TheColoredLampColors.GREEN.ordinal()), lampPages.toArray(new BookletPage[lampPages.size()])); + new BookletChapter("lamps", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockColoredLampOn.get(), 1, TheColoredLampColors.GREEN.ordinal()), lampPages.toArray(new BookletPage[lampPages.size()])); new BookletChapter("enderStar", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.ENDER_STAR.ordinal()), new PageCrafting(1, ItemCrafting.recipeEnderStar)); new BookletChapter("spawnerShard", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.SPAWNER_SHARD.ordinal()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.SPAWNER_SHARD.ordinal()))); - new BookletChapter("treasureChest", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockTreasureChest), new PagePicture(1, "page_treasure_chest", 150).addItemsToPage(new ItemStack(InitBlocks.blockTreasureChest)), new PageTextOnly(2)).setSpecial(); + // new BookletChapter("treasureChest", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockTreasureChest.get()), new PagePicture(1, "page_treasure_chest", 150).addItemsToPage(new ItemStack(InitBlocks.blockTreasureChest.get())), new PageTextOnly(2)).setSpecial(); new BookletChapter("hairBalls", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemHairyBall), new PagePicture(1, "page_fur_balls", 110).addItemsToPage(new ItemStack(InitItems.itemHairyBall)), new PageTextOnly(2)).setSpecial(); - new BookletChapter("blackLotus", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockBlackLotus), new PageTextOnly(1).addItemsToPage(new ItemStack(InitBlocks.blockBlackLotus)), new PageCrafting(2, ItemCrafting.recipeBlackDye)); + new BookletChapter("blackLotus", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockBlackLotus.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitBlocks.blockBlackLotus.get())), new PageCrafting(2, ItemCrafting.recipeBlackDye)); new BookletChapter("waterBowl", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemWaterBowl), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemWaterBowl))); - new BookletChapter("tinyTorch", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockTinyTorch), new PageCrafting(1, BlockCrafting.recipesTinyTorch).setWildcard()).setSpecial(); + new BookletChapter("tinyTorch", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockTinyTorch.get()), new PageCrafting(1, BlockCrafting.recipesTinyTorch).setWildcard()).setSpecial(); //Reconstruction chaptersIntroduction[7] = new BookletChapter("reconstructorLenses", ActuallyAdditionsAPI.entryReconstruction, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.LENS.ordinal()), new PageTextOnly(1)).setImportant(); @@ -223,61 +191,67 @@ public final class InitBooklet { //Laser Relays chaptersIntroduction[8] = new BookletChapter("laserIntro", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitItems.itemLaserWrench), new PageTextOnly(1), new PageTextOnly(2).addTextReplacement("", TileEntityLaserRelay.MAX_DISTANCE), new PageCrafting(3, ItemCrafting.recipeLaserWrench)).setImportant(); - new BookletChapter("laserRelays", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockLaserRelay), new PageTextOnly(1), new PageTextOnly(2).addTextReplacement("", TileEntityLaserRelayEnergy.CAP).addTextReplacement("", TileEntityLaserRelayEnergyAdvanced.CAP).addTextReplacement("", TileEntityLaserRelayEnergyExtreme.CAP), new PagePicture(3, "page_laser_relay", 0).setNoText(), new PageCrafting(4, BlockCrafting.recipeLaserRelay).setWildcard().setNoText(), new PageCrafting(5, BlockCrafting.recipeLaserRelayAdvanced).setWildcard().setNoText(), new PageCrafting(6, BlockCrafting.recipeLaserRelayExtreme).setWildcard().setNoText()); - new BookletChapter("fluidLaser", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockLaserRelayFluids), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeFluidLaser).setWildcard().setNoText()); - new BookletChapter("itemRelays", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockLaserRelayItem), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeItemLaser).setWildcard().setNoText()).setSpecial(); - new BookletChapter("itemInterfaces", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockItemViewer), new PageTextOnly(1), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipeItemInterface).setNoText()); - new BookletChapter("itemRelaysAdvanced", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockLaserRelayItemWhitelist), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeLaserRelayItemWhitelist).setWildcard()); - new BookletChapter("itemInterfacesHopping", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockItemViewerHopping), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeItemInterfaceHopping).setWildcard().setNoText()); + new BookletChapter("laserRelays", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockLaserRelay.get()), new PageTextOnly(1), new PageTextOnly(2).addTextReplacement("", TileEntityLaserRelayEnergy.CAP).addTextReplacement("", TileEntityLaserRelayEnergyAdvanced.CAP).addTextReplacement("", TileEntityLaserRelayEnergyExtreme.CAP), new PagePicture(3, "page_laser_relay", 0).setNoText(), new PageCrafting(4, BlockCrafting.recipeLaserRelay).setWildcard().setNoText(), new PageCrafting(5, BlockCrafting.recipeLaserRelayAdvanced).setWildcard().setNoText(), new PageCrafting(6, BlockCrafting.recipeLaserRelayExtreme).setWildcard().setNoText()); + new BookletChapter("fluidLaser", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockLaserRelayFluids.get()), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeFluidLaser).setWildcard().setNoText()); + new BookletChapter("itemRelays", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockLaserRelayItem.get()), new PageTextOnly(1), new PageReconstructor(2, LensRecipeHandler.recipeItemLaser).setWildcard().setNoText()).setSpecial(); + new BookletChapter("itemInterfaces", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockItemViewer.get()), new PageTextOnly(1), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipeItemInterface).setNoText()); + new BookletChapter("itemRelaysAdvanced", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockLaserRelayItemWhitelist.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeLaserRelayItemWhitelist).setWildcard()); + new BookletChapter("itemInterfacesHopping", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitBlocks.blockItemViewerHopping.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeItemInterfaceHopping).setWildcard().setNoText()); new BookletChapter("laserUpgradeInvisibility", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitItems.itemLaserUpgradeInvisibility), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeLaserUpgradeInvisibility).setNoText()).setImportant(); new BookletChapter("laserUpgradeRange", ActuallyAdditionsAPI.entryLaserRelays, new ItemStack(InitItems.itemLaserUpgradeRange), new PageTextOnly(1).addTextReplacement("", TileEntityLaserRelay.MAX_DISTANCE).addTextReplacement("", TileEntityLaserRelay.MAX_DISTANCE_RANGED), new PageCrafting(2, ItemCrafting.recipeLaserUpgradeRange).setNoText()).setImportant(); //No RF Using Blocks - new BookletChapter("breaker", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockBreaker), new PageCrafting(1, BlockCrafting.recipeBreaker).setWildcard(), new PageCrafting(2, BlockCrafting.recipePlacer).setWildcard(), new PageCrafting(3, BlockCrafting.recipeLiquidPlacer).setWildcard(), new PageCrafting(4, BlockCrafting.recipeLiquidCollector).setWildcard()); - new BookletChapter("dropper", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockDropper), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeDropper).setNoText()); - new BookletChapter("phantomfaces", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockPhantomLiquiface), new PageTextOnly(1).addTextReplacement("", TileEntityPhantomface.RANGE), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipePhantomface), new PageCrafting(4, BlockCrafting.recipeLiquiface), new PageCrafting(5, BlockCrafting.recipeEnergyface), new PageCrafting(6, ItemCrafting.recipePhantomConnector).setNoText(), new PageCrafting(7, BlockCrafting.recipePhantomBooster)).setImportant(); - new BookletChapter("phantomRedstoneface", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockPhantomRedstoneface), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipePhantomRedstoneface).setNoText()); - new BookletChapter("phantomBreaker", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockPhantomBreaker), new PageTextOnly(1).addTextReplacement("", TileEntityPhantomPlacer.RANGE), new PageCrafting(2, BlockCrafting.recipePhantomPlacer).setNoText(), new PageCrafting(3, BlockCrafting.recipePhantomBreaker).setNoText()); - new BookletChapter("esd", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockInputterAdvanced), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeESD).setNoText(), new PageCrafting(3, BlockCrafting.recipeAdvancedESD).setNoText()).setSpecial(); - new BookletChapter("xpSolidifier", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockXPSolidifier), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemSolidifiedExperience)), new PageCrafting(2, BlockCrafting.recipeSolidifier).setNoText()).setImportant(); - new BookletChapter("greenhouseGlass", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockGreenhouseGlass), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeGlass)); - new BookletChapter("fishingNet", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockFishingNet), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFisher).setNoText()); - new BookletChapter("feeder", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockFeeder), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFeeder).setNoText()); - new BookletChapter("compost", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockCompost), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemFertilizer)), new PageCrafting(2, BlockCrafting.recipeCompost).setNoText(), new PageTextOnly(3).addItemsToPage(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.MASHED_FOOD.ordinal()))); - new BookletChapter("crate", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockGiantChest), new PageCrafting(1, BlockCrafting.recipeCrate), new PageCrafting(2, BlockCrafting.recipeCrateMedium).setNoText(), new PageCrafting(3, BlockCrafting.recipeCrateLarge).setNoText(), new PageCrafting(4, ItemCrafting.recipeCrateKeeper), new PageCrafting(5, ItemCrafting.recipeChestToCrateUpgrade), new PageCrafting(6, ItemCrafting.recipeSmallToMediumCrateUpgrade), new PageCrafting(7, ItemCrafting.recipeMediumToLargeCrateUpgrade)); - new BookletChapter("rangedCollector", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockRangedCollector), new PageTextOnly(1).addTextReplacement("", TileEntityRangedCollector.RANGE), new PageCrafting(2, BlockCrafting.recipeRangedCollector).setNoText()); + new BookletChapter("breaker", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockBreaker.get()), new PageCrafting(1, BlockCrafting.recipeBreaker).setWildcard(), new PageCrafting(2, BlockCrafting.recipePlacer).setWildcard(), new PageCrafting(3, BlockCrafting.recipeLiquidPlacer).setWildcard(), new PageCrafting(4, BlockCrafting.recipeLiquidCollector).setWildcard()); + new BookletChapter("dropper", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockDropper.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeDropper).setNoText()); + new BookletChapter("phantomfaces", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockPhantomLiquiface.get()), new PageTextOnly(1).addTextReplacement("", TileEntityPhantomface.RANGE), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipePhantomface), new PageCrafting(4, BlockCrafting.recipeLiquiface), new PageCrafting(5, BlockCrafting.recipeEnergyface), new PageCrafting(6, ItemCrafting.recipePhantomConnector).setNoText(), new PageCrafting(7, BlockCrafting.recipePhantomBooster)).setImportant(); + new BookletChapter("phantomRedstoneface", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockPhantomRedstoneface.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipePhantomRedstoneface).setNoText()); + new BookletChapter("phantomBreaker", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockPhantomBreaker.get()), new PageTextOnly(1).addTextReplacement("", TileEntityPhantomPlacer.RANGE), new PageCrafting(2, BlockCrafting.recipePhantomPlacer).setNoText(), new PageCrafting(3, BlockCrafting.recipePhantomBreaker).setNoText()); + new BookletChapter("esd", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockInputterAdvanced.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeESD).setNoText(), new PageCrafting(3, BlockCrafting.recipeAdvancedESD).setNoText()).setSpecial(); + new BookletChapter("xpSolidifier", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockXPSolidifier.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemSolidifiedExperience)), new PageCrafting(2, BlockCrafting.recipeSolidifier).setNoText()).setImportant(); + new BookletChapter("greenhouseGlass", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockGreenhouseGlass.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeGlass)); + new BookletChapter("fishingNet", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockFishingNet.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFisher).setNoText()); + new BookletChapter("feeder", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockFeeder.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeFeeder).setNoText()); + new BookletChapter("compost", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockCompost.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemFertilizer)), new PageCrafting(2, BlockCrafting.recipeCompost).setNoText(), new PageTextOnly(3).addItemsToPage(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.MASHED_FOOD.ordinal()))); + new BookletChapter("crate", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockGiantChest.get()), new PageCrafting(1, BlockCrafting.recipeCrate), new PageCrafting(2, BlockCrafting.recipeCrateMedium).setNoText(), new PageCrafting(3, BlockCrafting.recipeCrateLarge).setNoText(), new PageCrafting(4, ItemCrafting.recipeCrateKeeper), new PageCrafting(5, ItemCrafting.recipeChestToCrateUpgrade), new PageCrafting(6, ItemCrafting.recipeSmallToMediumCrateUpgrade), new PageCrafting(7, ItemCrafting.recipeMediumToLargeCrateUpgrade)); + new BookletChapter("rangedCollector", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockRangedCollector.get()), new PageTextOnly(1).addTextReplacement("", TileEntityRangedCollector.RANGE), new PageCrafting(2, BlockCrafting.recipeRangedCollector).setNoText()); //RF Using Blocks - new BookletChapter("fireworkBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFireworkBox), new PageTextOnly(1).addTextReplacement("", TileEntityFireworkBox.USE_PER_SHOT), new PageCrafting(2, BlockCrafting.recipeFireworkBox)).setSpecial(); - new BookletChapter("batteryBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockBatteryBox), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeBatteryBox).setNoText()).setSpecial(); - new BookletChapter("farmer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFarmer), new PageTextOnly(1), new PagePicture(2, "page_farmer_crops", 95).addItemsToPage(new ItemStack(Items.WHEAT_SEEDS)).addItemsToPage(new ItemStack(InitItems.itemCanolaSeed)), new PagePicture(3, "page_farmer_cactus", 105).addItemsToPage(new ItemStack(Blocks.CACTUS)), new PagePicture(4, "page_farmer_wart", 95).addItemsToPage(new ItemStack(Items.NETHER_WART)), new PagePicture(5, "page_farmer_reeds", 105).addItemsToPage(new ItemStack(Items.REEDS)), new PagePicture(6, "page_farmer_melons", 105).addItemsToPage(new ItemStack(Items.MELON), new ItemStack(Blocks.PUMPKIN), new ItemStack(Blocks.MELON_BLOCK)), new PagePicture(7, "page_farmer_enderlilly", 105), new PagePicture(8, "page_farmer_redorchid", 105), new PageCrafting(4, BlockCrafting.recipeFarmer).setWildcard().setNoText()).setImportant(); - new BookletChapter("miner", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockMiner), new PageTextOnly(1).addTextReplacement("", TileEntityMiner.ENERGY_USE_PER_BLOCK).addTextReplacement("", TileEntityMiner.DEFAULT_RANGE), new PageCrafting(2, BlockCrafting.recipeMiner)).setSpecial(); - new BookletChapterCoffee("coffeeMachine", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockCoffeeMachine), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemCoffeeBean)).addTextReplacement("", TileEntityCoffeeMachine.ENERGY_USED).addTextReplacement("", TileEntityCoffeeMachine.CACHE_USE).addTextReplacement("", TileEntityCoffeeMachine.WATER_USE), new PageTextOnly(2).addItemsToPage(new ItemStack(InitItems.itemCoffee)), new PagePicture(3, "page_coffee_machine", 115), new PageCrafting(4, BlockCrafting.recipeCoffeeMachine).setWildcard().setNoText(), new PageCrafting(5, ItemCrafting.recipeCup).setNoText()).setImportant(); + new BookletChapter("fireworkBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFireworkBox.get()), new PageTextOnly(1).addTextReplacement("", TileEntityFireworkBox.USE_PER_SHOT), new PageCrafting(2, BlockCrafting.recipeFireworkBox)).setSpecial(); + new BookletChapter("batteryBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockBatteryBox.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeBatteryBox).setNoText()).setSpecial(); + new BookletChapter("farmer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFarmer.get()), new PageTextOnly(1), new PagePicture(2, "page_farmer_crops", 95).addItemsToPage(new ItemStack(Items.WHEAT_SEEDS)).addItemsToPage(new ItemStack(InitItems.itemCanolaSeed)), new PagePicture(3, "page_farmer_cactus", 105).addItemsToPage(new ItemStack(Blocks.CACTUS)), new PagePicture(4, "page_farmer_wart", 95).addItemsToPage(new ItemStack(Items.NETHER_WART)), new PagePicture(5, "page_farmer_reeds", 105).addItemsToPage(new ItemStack(Items.REEDS)), new PagePicture(6, "page_farmer_melons", 105).addItemsToPage(new ItemStack(Items.MELON), new ItemStack(Blocks.PUMPKIN), new ItemStack(Blocks.MELON_BLOCK)), new PagePicture(7, "page_farmer_enderlilly", 105), new PagePicture(8, "page_farmer_redorchid", 105), new PageCrafting(4, BlockCrafting.recipeFarmer).setWildcard().setNoText()).setImportant(); + new BookletChapter("miner", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockMiner.get()), new PageTextOnly(1).addTextReplacement("", TileEntityMiner.ENERGY_USE_PER_BLOCK).addTextReplacement("", TileEntityMiner.DEFAULT_RANGE), new PageCrafting(2, BlockCrafting.recipeMiner)).setSpecial(); + new BookletChapterCoffee("coffeeMachine", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockCoffeeMachine.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemCoffeeBean)).addTextReplacement("", TileEntityCoffeeMachine.ENERGY_USED).addTextReplacement("", TileEntityCoffeeMachine.CACHE_USE).addTextReplacement("", TileEntityCoffeeMachine.WATER_USE), new PageTextOnly(2).addItemsToPage(new ItemStack(InitItems.itemCoffee)), new PagePicture(3, "page_coffee_machine", 115), new PageCrafting(4, BlockCrafting.recipeCoffeeMachine).setWildcard().setNoText(), new PageCrafting(5, ItemCrafting.recipeCup).setNoText()).setImportant(); List list = new ArrayList<>(); list.add(new PageTextOnly(1).addTextReplacement("", TileEntityGrinder.ENERGY_USE)); list.add(new PageCrafting(2, BlockCrafting.recipeCrusher).setWildcard().setNoText()); list.add(new PageCrafting(3, BlockCrafting.recipeDoubleCrusher).setWildcard().setNoText()); - if (CrusherCrafting.recipeIronHorseArmor != null) list.add(new PageCrusherRecipe(4, CrusherCrafting.recipeIronHorseArmor).setNoText()); - if (CrusherCrafting.recipeGoldHorseArmor != null) list.add(new PageCrusherRecipe(5, CrusherCrafting.recipeGoldHorseArmor).setNoText()); - if (CrusherCrafting.recipeDiamondHorseArmor != null) list.add(new PageCrusherRecipe(6, CrusherCrafting.recipeDiamondHorseArmor).setNoText()); + if (CrusherCrafting.recipeIronHorseArmor != null) { + list.add(new PageCrusherRecipe(4, CrusherCrafting.recipeIronHorseArmor).setNoText()); + } + if (CrusherCrafting.recipeGoldHorseArmor != null) { + list.add(new PageCrusherRecipe(5, CrusherCrafting.recipeGoldHorseArmor).setNoText()); + } + if (CrusherCrafting.recipeDiamondHorseArmor != null) { + list.add(new PageCrusherRecipe(6, CrusherCrafting.recipeDiamondHorseArmor).setNoText()); + } - new BookletChapterCrusher("crusher", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockGrinderDouble), list.toArray(new IBookletPage[0])); - new BookletChapter("furnaceDouble", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFurnaceDouble), new PageCrafting(1, BlockCrafting.recipeFurnace).setWildcard().addTextReplacement("", TileEntityFurnaceDouble.ENERGY_USE)); - new BookletChapter("lavaFactory", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockLavaFactoryController), new PageTextOnly(1).addTextReplacement("", TileEntityLavaFactoryController.ENERGY_USE), new PagePicture(2, "page_lava_factory", 0).setNoText(), new PageCrafting(3, BlockCrafting.recipeLavaFactory).setNoText(), new PageCrafting(4, BlockCrafting.recipeCasing).setNoText()); - new BookletChapter("energizer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockEnergizer), new PageCrafting(1, BlockCrafting.recipeEnergizer), new PageCrafting(2, BlockCrafting.recipeEnervator)); - new BookletChapter("repairer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockItemRepairer), new PageCrafting(1, BlockCrafting.recipeRepairer).addTextReplacement("", TileEntityItemRepairer.ENERGY_USE)); - new BookletChapter("longRangeBreaker", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockDirectionalBreaker), new PageTextOnly(1).addTextReplacement("", TileEntityDirectionalBreaker.ENERGY_USE).addTextReplacement("", TileEntityDirectionalBreaker.RANGE), new PageCrafting(2, BlockCrafting.recipeDirectionalBreaker).setWildcard()); - new BookletChapter("playerInterface", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockPlayerInterface), new PageTextOnly(1).addTextReplacement("", TileEntityPlayerInterface.DEFAULT_RANGE), new PageCrafting(2, BlockCrafting.recipePlayerInterface).setNoText()).setSpecial(); - new BookletChapter("displayStand", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockDisplayStand), new PageTextOnly(1), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipeDisplayStand).setNoText()).setSpecial(); - new BookletChapter("shockSuppressor", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockShockSuppressor), new PageTextOnly(1).addTextReplacement("", TileEntityShockSuppressor.RANGE).addTextReplacement("", TileEntityShockSuppressor.USE_PER), new PageCrafting(2, BlockCrafting.recipeShockSuppressor)); + new BookletChapterCrusher("crusher", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockGrinderDouble.get()), list.toArray(new IBookletPage[0])); + new BookletChapter("furnaceDouble", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFurnaceDouble.get()), new PageCrafting(1, BlockCrafting.recipeFurnace).setWildcard().addTextReplacement("", TileEntityFurnaceDouble.ENERGY_USE)); + new BookletChapter("lavaFactory", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockLavaFactoryController.get()), new PageTextOnly(1).addTextReplacement("", TileEntityLavaFactoryController.ENERGY_USE), new PagePicture(2, "page_lava_factory", 0).setNoText(), new PageCrafting(3, BlockCrafting.recipeLavaFactory).setNoText(), new PageCrafting(4, BlockCrafting.recipeCasing).setNoText()); + new BookletChapter("energizer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockEnergizer.get()), new PageCrafting(1, BlockCrafting.recipeEnergizer), new PageCrafting(2, BlockCrafting.recipeEnervator)); + new BookletChapter("repairer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockItemRepairer.get()), new PageCrafting(1, BlockCrafting.recipeRepairer).addTextReplacement("", TileEntityItemRepairer.ENERGY_USE)); + new BookletChapter("longRangeBreaker", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockDirectionalBreaker.get()), new PageTextOnly(1).addTextReplacement("", TileEntityDirectionalBreaker.ENERGY_USE).addTextReplacement("", TileEntityDirectionalBreaker.RANGE), new PageCrafting(2, BlockCrafting.recipeDirectionalBreaker).setWildcard()); + new BookletChapter("playerInterface", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockPlayerInterface.get()), new PageTextOnly(1).addTextReplacement("", TileEntityPlayerInterface.DEFAULT_RANGE), new PageCrafting(2, BlockCrafting.recipePlayerInterface).setNoText()).setSpecial(); + new BookletChapter("displayStand", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockDisplayStand.get()), new PageTextOnly(1), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipeDisplayStand).setNoText()).setSpecial(); + new BookletChapter("shockSuppressor", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockShockSuppressor.get()), new PageTextOnly(1).addTextReplacement("", TileEntityShockSuppressor.RANGE).addTextReplacement("", TileEntityShockSuppressor.USE_PER), new PageCrafting(2, BlockCrafting.recipeShockSuppressor)); //RF Generating Blocks - new BookletChapter("solarPanel", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockFurnaceSolar), new PageTextOnly(1).addTextReplacement("", TileEntityFurnaceSolar.PRODUCE), new PageCrafting(2, BlockCrafting.recipeSolar).setNoText()); - new BookletChapter("heatCollector", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockHeatCollector), new PageTextOnly(1).addTextReplacement("", TileEntityHeatCollector.ENERGY_PRODUCE).addTextReplacement("", TileEntityHeatCollector.BLOCKS_NEEDED), new PageCrafting(2, BlockCrafting.recipeHeatCollector).setNoText()); - new BookletChapter("canola", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockFermentingBarrel), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal())).addItemsToPage(new ItemStack(InitItems.itemCanolaSeed)).addFluidToPage(InitFluids.fluidCanolaOil), new PageTextOnly(2).addFluidToPage(InitFluids.fluidRefinedCanolaOil).addFluidToPage(InitFluids.fluidCrystalOil).addFluidToPage(InitFluids.fluidEmpoweredOil), new PageCrafting(3, BlockCrafting.recipeCanolaPress).setNoText(), new PageCrafting(4, BlockCrafting.recipeFermentingBarrel), new PageCrafting(5, BlockCrafting.recipeOilGen), new PageReconstructor(6, LensRecipeHandler.recipeCrystallizedCanolaSeed).setNoText(), new PageEmpowerer(7, EmpowererHandler.recipeEmpoweredCanolaSeed).setNoText()); - new BookletChapter("leafGen", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockLeafGenerator), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.LEAF_GENERATOR_CF_PER_LEAF.getValue()).addTextReplacement("", ConfigIntValues.LEAF_GENERATOR_AREA.getValue()), new PageCrafting(2, BlockCrafting.recipeLeafGen)).setImportant(); - new BookletChapter("bioReactor", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockBioReactor), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeBioReactor).setNoText()).setSpecial(); + new BookletChapter("solarPanel", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockFurnaceSolar.get()), new PageTextOnly(1).addTextReplacement("", TileEntityFurnaceSolar.PRODUCE), new PageCrafting(2, BlockCrafting.recipeSolar).setNoText()); + new BookletChapter("heatCollector", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockHeatCollector.get()), new PageTextOnly(1).addTextReplacement("", TileEntityHeatCollector.ENERGY_PRODUCE).addTextReplacement("", TileEntityHeatCollector.BLOCKS_NEEDED), new PageCrafting(2, BlockCrafting.recipeHeatCollector).setNoText()); + new BookletChapter("canola", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockFermentingBarrel.get()), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal())).addItemsToPage(new ItemStack(InitItems.itemCanolaSeed)).addFluidToPage(InitFluids.fluidCanolaOil), new PageTextOnly(2).addFluidToPage(InitFluids.fluidRefinedCanolaOil).addFluidToPage(InitFluids.fluidCrystalOil).addFluidToPage(InitFluids.fluidEmpoweredOil), new PageCrafting(3, BlockCrafting.recipeCanolaPress).setNoText(), new PageCrafting(4, BlockCrafting.recipeFermentingBarrel), new PageCrafting(5, BlockCrafting.recipeOilGen), new PageReconstructor(6, LensRecipeHandler.recipeCrystallizedCanolaSeed).setNoText(), new PageEmpowerer(7, EmpowererHandler.recipeEmpoweredCanolaSeed).setNoText()); + new BookletChapter("leafGen", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockLeafGenerator.get()), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.LEAF_GENERATOR_CF_PER_LEAF.getValue()).addTextReplacement("", ConfigIntValues.LEAF_GENERATOR_AREA.getValue()), new PageCrafting(2, BlockCrafting.recipeLeafGen)).setImportant(); + new BookletChapter("bioReactor", ActuallyAdditionsAPI.entryGeneratingRF, new ItemStack(InitBlocks.blockBioReactor.get()), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeBioReactor).setNoText()).setSpecial(); //No RF Using Items chaptersIntroduction[9] = new BookletChapter("goggles", ActuallyAdditionsAPI.entryItemsNonRF, new ItemStack(InitItems.itemEngineerGoggles), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeGoggles).setNoText(), new PageCrafting(3, ItemCrafting.recipeGogglesAdvanced).setNoText()).setImportant(); @@ -327,6 +301,6 @@ public final class InitBooklet { new BookletChapterTrials("autoDisenchanter", new ItemStack(InitItems.itemDisenchantingLens), false); new BookletChapterTrials("empoweredOil", FluidUtil.getFilledBucket(new FluidStack(InitFluids.fluidEmpoweredOil, Fluid.BUCKET_VOLUME)), false); new BookletChapterTrials("mobFarm", new ItemStack(Items.ROTTEN_FLESH), false); - new BookletChapterTrials("empowererAutomation", new ItemStack(InitBlocks.blockEmpowerer), false); + new BookletChapterTrials("empowererAutomation", new ItemStack(InitBlocks.blockEmpowerer.get()), false); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java index 663bd6821..7e8a8ff1b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java @@ -10,6 +10,7 @@ package de.ellpeck.actuallyadditions.mod.event; +import com.mojang.blaze3d.platform.GlStateManager; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.IHudDisplay; import de.ellpeck.actuallyadditions.mod.config.ConfigValues; @@ -20,38 +21,40 @@ import de.ellpeck.actuallyadditions.mod.inventory.gui.EnergyDisplay; import de.ellpeck.actuallyadditions.mod.items.ItemWingsOfTheBats; import de.ellpeck.actuallyadditions.mod.tile.IEnergyDisplay; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; +import de.ellpeck.actuallyadditions.mod.util.Help; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.gui.screen.Screen; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.item.ItemSword; +import net.minecraft.item.SwordItem; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.util.math.RayTraceResult; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.TextFormatting; +import net.minecraftforge.api.distmarker.Dist; +import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.TickEvent; import net.minecraftforge.event.entity.player.ItemTooltipEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent; -import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; -import net.minecraftforge.fml.relauncher.OnlyIn; -import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.eventbus.api.SubscribeEvent; import java.util.Locale; @OnlyIn(Dist.CLIENT) public class ClientEvents { - private static final String ADVANCED_INFO_TEXT_PRE = TextFormatting.DARK_GRAY + " "; - private static final String ADVANCED_INFO_HEADER_PRE = TextFormatting.GRAY + " -"; + private static final ITextComponent ADVANCED_INFO_TEXT_PRE = new StringTextComponent(" -").mergeStyle(TextFormatting.DARK_GRAY); + private static final ITextComponent ADVANCED_INFO_HEADER_PRE = new StringTextComponent(" -").mergeStyle(TextFormatting.GRAY); private static EnergyDisplay energyDisplay; @@ -59,9 +62,10 @@ public class ClientEvents { MinecraftForge.EVENT_BUS.register(this); } + // TODO: [port] the fuck? @SubscribeEvent - public void onClientTick(ClientTickEvent event) { - if (event.phase == Phase.END) { + public void onClientTick(TickEvent.ClientTickEvent event) { + if (event.phase == TickEvent.Phase.END) { Minecraft mc = Minecraft.getInstance(); if (mc.world == null) { @@ -86,7 +90,7 @@ public class ClientEvents { } } - if (ItemWingsOfTheBats.THE_BAT_BAT.equalsIgnoreCase(stack.getDisplayName()) && stack.getItem() instanceof ItemSword) { + if (ItemWingsOfTheBats.THE_BAT_BAT.equalsIgnoreCase(stack.getDisplayName()) && stack.getItem() instanceof SwordItem) { event.getToolTip().set(0, TextFormatting.GOLD + event.getToolTip().get(0)); event.getToolTip().add(1, TextFormatting.RED.toString() + TextFormatting.ITALIC + "That's a really bat pun"); } @@ -95,19 +99,20 @@ public class ClientEvents { //Advanced Item Info if (event.getFlags().isAdvanced() && StackUtil.isValid(event.getItemStack())) { if (ConfigBoolValues.CTRL_EXTRA_INFO.isEnabled()) { - if (GuiScreen.isCtrlKeyDown()) { - event.getToolTip().add(TextFormatting.DARK_GRAY + "" + TextFormatting.ITALIC + StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".extraInfo.desc") + ":"); + if (Screen.hasControlDown()) { + event.getToolTip().add(Help.Trans("tooltip.", ".extraInfo.desc").mergeStyle(TextFormatting.DARK_GRAY).mergeStyle(TextFormatting.ITALIC).append(new StringTextComponent(":"))); + // TODO: [port] come back to this and see if we can re-add it //OreDict Names - int[] oreIDs = OreDictionary.getOreIDs(event.getItemStack()); - event.getToolTip().add(ADVANCED_INFO_HEADER_PRE + StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".oredictName.desc") + ":"); - if (oreIDs.length > 0) { - for (int oreID : oreIDs) { - event.getToolTip().add(ADVANCED_INFO_TEXT_PRE + OreDictionary.getOreName(oreID)); - } - } else { - event.getToolTip().add(ADVANCED_INFO_TEXT_PRE + StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".noOredictNameAvail.desc")); - } + // int[] oreIDs = OreDictionary.getOreIDs(event.getItemStack()); + // event.getToolTip().add(ADVANCED_INFO_HEADER_PRE + StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".oredictName.desc") + ":"); + // if (oreIDs.length > 0) { + // for (int oreID : oreIDs) { + // event.getToolTip().add(ADVANCED_INFO_TEXT_PRE + OreDictionary.getOreName(oreID)); + // } + // } else { + // event.getToolTip().add(ADVANCED_INFO_TEXT_PRE + StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".noOredictNameAvail.desc")); + // } //Code Name event.getToolTip().add(ADVANCED_INFO_HEADER_PRE + StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".codeName.desc") + ":"); @@ -139,7 +144,7 @@ public class ClientEvents { CompoundNBT compound = event.getItemStack().getTagCompound(); if (compound != null && !compound.isEmpty()) { event.getToolTip().add(ADVANCED_INFO_HEADER_PRE + StringUtil.localize("tooltip." + ActuallyAdditions.MODID + ".nbt.desc") + ":"); - if (GuiScreen.isShiftKeyDown()) { + if (Screen.hasShiftDown()) { int limit = ConfigIntValues.CTRL_INFO_NBT_CHAR_LIMIT.getValue(); String compoundStrg = compound.toString(); int compoundStrgLength = compoundStrg.length(); @@ -170,25 +175,30 @@ public class ClientEvents { @SubscribeEvent public void onGameOverlay(RenderGameOverlayEvent.Post event) { - if (event.getType() == RenderGameOverlayEvent.ElementType.ALL && Minecraft.getInstance().currentScreen == null) { - Minecraft minecraft = Minecraft.getInstance(); + Minecraft minecraft = Minecraft.getInstance(); + if (event.getType() == RenderGameOverlayEvent.ElementType.ALL && minecraft.currentScreen == null) { PlayerEntity player = minecraft.player; + if (player == null) { + return; + } + RayTraceResult posHit = minecraft.objectMouseOver; FontRenderer font = minecraft.fontRenderer; ItemStack stack = player.getHeldItemMainhand(); if (StackUtil.isValid(stack)) { if (stack.getItem() instanceof IHudDisplay) { - ((IHudDisplay) stack.getItem()).displayHud(minecraft, player, stack, posHit, event.getResolution()); + ((IHudDisplay) stack.getItem()).displayHud(minecraft, player, stack, posHit, event.getWindow()); } } - if (posHit != null && posHit.getBlockPos() != null) { - Block blockHit = minecraft.world.getBlockState(posHit.getBlockPos()).getBlock(); - TileEntity tileHit = minecraft.world.getTileEntity(posHit.getBlockPos()); + if (posHit != null && posHit.getType() == RayTraceResult.Type.BLOCK) { + BlockRayTraceResult rayCast = (BlockRayTraceResult) posHit; + Block blockHit = minecraft.world.getBlockState(rayCast.getPos()).getBlock(); + TileEntity tileHit = minecraft.world.getTileEntity(rayCast.getPos()); if (blockHit instanceof IHudDisplay) { - ((IHudDisplay) blockHit).displayHud(minecraft, player, stack, posHit, event.getResolution()); + ((IHudDisplay) blockHit).displayHud(minecraft, player, stack, posHit, event.getWindow()); } if (tileHit instanceof TileEntityBase) { @@ -197,7 +207,7 @@ public class ClientEvents { String strg = String.format("%s: %s", StringUtil.localize("info." + ActuallyAdditions.MODID + ".redstoneMode.name"), TextFormatting.DARK_RED + StringUtil.localize("info." + ActuallyAdditions.MODID + ".redstoneMode." + (base.isPulseMode ? "pulse" : "deactivation")) + TextFormatting.RESET); - font.drawStringWithShadow(strg, event.getResolution().getScaledWidth() / 2 + 5, event.getResolution().getScaledHeight() / 2 + 5, StringUtil.DECIMAL_COLOR_WHITE); + font.drawStringWithShadow(event.getMatrixStack(), strg, event.getWindow().getScaledWidth() / 2f + 5, event.getWindow().getScaledHeight() / 2f + 5, StringUtil.DECIMAL_COLOR_WHITE); String expl; if (StackUtil.isValid(stack) && stack.getItem() == ConfigValues.itemRedstoneTorchConfigurator) { @@ -205,7 +215,7 @@ public class ClientEvents { } else { expl = TextFormatting.GRAY.toString() + TextFormatting.ITALIC + StringUtil.localizeFormatted("info." + ActuallyAdditions.MODID + ".redstoneMode.invalidItem", StringUtil.localize(ConfigValues.itemRedstoneTorchConfigurator.getTranslationKey() + ".name")); } - font.drawStringWithShadow(expl, event.getResolution().getScaledWidth() / 2 + 5, event.getResolution().getScaledHeight() / 2 + 15, StringUtil.DECIMAL_COLOR_WHITE); + font.drawStringWithShadow(event.getMatrixStack(), expl, event.getWindow().getScaledWidth() / 2f + 5, event.getWindow().getScaledHeight() / 2f + 15, StringUtil.DECIMAL_COLOR_WHITE); } } @@ -215,10 +225,10 @@ public class ClientEvents { if (energyDisplay == null) { energyDisplay = new EnergyDisplay(0, 0, null); } - energyDisplay.setData(2, event.getResolution().getScaledHeight() - 96, display.getEnergyStorage(), true, true); + energyDisplay.setData(2, event.getWindow().getScaledHeight() - 96, display.getEnergyStorage(), true, true); GlStateManager.pushMatrix(); - GlStateManager.color(1F, 1F, 1F, 1F); + GlStateManager.color4f(1F, 1F, 1F, 1F); energyDisplay.draw(); GlStateManager.popMatrix(); } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/FluidAA.java b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/FluidAA.java index 46d56d317..fcf7e82db 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/FluidAA.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/FluidAA.java @@ -11,8 +11,8 @@ package de.ellpeck.actuallyadditions.mod.fluids; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; +import net.minecraft.fluid.Fluid; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fluids.Fluid; public class FluidAA extends Fluid { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java index 138dae324..ddf0a6d8a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/fluids/InitFluids.java @@ -10,19 +10,24 @@ package de.ellpeck.actuallyadditions.mod.fluids; +import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.blocks.base.BlockFluidFlowing; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.fluid.Fluid; +import net.minecraftforge.fml.RegistryObject; +import net.minecraftforge.registries.DeferredRegister; +import net.minecraftforge.registries.ForgeRegistries; import java.util.Locale; public final class InitFluids { + public static final DeferredRegister FLUIDS = DeferredRegister.create(ForgeRegistries.FLUIDS, ActuallyAdditions.MODID); - public static Fluid fluidCanolaOil; - public static Fluid fluidRefinedCanolaOil; - public static Fluid fluidCrystalOil; - public static Fluid fluidEmpoweredOil; + public static final RegistryObject fluidCanolaOil = FLUIDS.register("canolaoil", () -> registerFluid("block_canola_oil")); + public static final RegistryObject fluidRefinedCanolaOil = FLUIDS.register("refinedcanolaoil", () -> registerFluid("block_refined_canola_oil")); + public static final RegistryObject fluidCrystalOil = FLUIDS.register("crystaloil", () -> registerFluid("block_crystal_oil")); + public static final RegistryObject fluidEmpoweredOil = FLUIDS.register("empoweredoil", () -> registerFluid("block_empowered_oil")); public static Block blockCanolaOil; public static Block blockRefinedCanolaOil; @@ -41,12 +46,12 @@ public final class InitFluids { blockEmpoweredOil = registerFluidBlock(fluidEmpoweredOil, Material.WATER, "block_empowered_oil"); } - private static Fluid registerFluid(String fluidName, String fluidTextureName, EnumRarity rarity) { - Fluid fluid = new FluidAA(fluidName.toLowerCase(Locale.ROOT), fluidTextureName).setRarity(rarity); - FluidRegistry.registerFluid(fluid); - FluidRegistry.addBucketForFluid(fluid); + private static Fluid registerFluid(String fluidName, String fluidTextureName) { + Fluid fluid = new FluidAA(fluidName.toLowerCase(Locale.ROOT), fluidTextureName); + // FluidRegistry.registerFluid(fluid); + // FluidRegistry.addBucketForFluid(fluid); - return FluidRegistry.getFluid(fluid.getName()); + return fluid; } private static Block registerFluidBlock(Fluid fluid, Material material, String name) { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBag.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBag.java index 13b1bb1c9..3728e4574 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBag.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerBag.java @@ -22,19 +22,19 @@ import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor; import de.ellpeck.actuallyadditions.mod.tile.FilterSettings; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA; import de.ellpeck.actuallyadditions.mod.util.StackUtil; -import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.inventory.ClickType; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IContainerListener; -import net.minecraft.inventory.Slot; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.inventory.container.ClickType; +import net.minecraft.inventory.container.Container; +import net.minecraft.inventory.container.IContainerListener; +import net.minecraft.inventory.container.Slot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.ResourceLocation; import net.minecraftforge.api.distmarker.Dist; -import net.minecraftforge.fml.common.registry.ForgeRegistries; -import net.minecraftforge.fml.relauncher.OnlyIn; +import net.minecraftforge.api.distmarker.OnlyIn; +import net.minecraftforge.registries.ForgeRegistries; import org.apache.commons.lang3.tuple.Pair; import java.util.ArrayList; @@ -49,8 +49,8 @@ public class ContainerBag extends Container implements IButtonReactor { public boolean autoInsert; private boolean oldAutoInsert; private final ItemStack sack; - - public ContainerBag(ItemStack sack, InventoryPlayer inventory, boolean isVoid) { + + public ContainerBag(ItemStack sack, PlayerInventory inventory, boolean isVoid) { this.inventory = inventory; this.bagInventory = new ItemStackHandlerAA(getSlotAmount(isVoid), (slot, stack, automation) -> !isBlacklisted(stack), ItemStackHandlerAA.REMOVE_TRUE); this.isVoid = isVoid; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java index 514e0e657..15deaa553 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemBooklet.java @@ -20,8 +20,8 @@ import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import de.ellpeck.actuallyadditions.mod.util.StringUtil; import net.minecraft.block.Block; +import net.minecraft.client.MainWindow; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.EnumRarity; @@ -98,7 +98,7 @@ public class ItemBooklet extends ItemBase implements IHudDisplay { @Override @OnlyIn(Dist.CLIENT) - public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, ScaledResolution resolution) { + public void displayHud(Minecraft minecraft, PlayerEntity player, ItemStack stack, RayTraceResult posHit, MainWindow resolution) { if (posHit != null && posHit.getBlockPos() != null) { BlockState state = minecraft.world.getBlockState(posHit.getBlockPos()); Block block = state.getBlock(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/RecipeWrapperWithButton.java b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/RecipeWrapperWithButton.java index 90b4ec7e8..46516c78a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/jei/RecipeWrapperWithButton.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/jei/RecipeWrapperWithButton.java @@ -16,14 +16,13 @@ import de.ellpeck.actuallyadditions.mod.booklet.gui.GuiBooklet; import de.ellpeck.actuallyadditions.mod.booklet.misc.BookletUtils; import de.ellpeck.actuallyadditions.mod.inventory.gui.TexturedButton; import de.ellpeck.actuallyadditions.mod.util.StringUtil; -import mezz.jei.api.recipe.IRecipeWrapper; import net.minecraft.client.Minecraft; import javax.annotation.Nullable; import java.util.Collections; import java.util.List; -public abstract class RecipeWrapperWithButton implements IRecipeWrapper { +public abstract class RecipeWrapperWithButton implements IRecipeWr { protected final TexturedButton theButton; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DamageSources.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DamageSources.java index 8253398da..c2024ff85 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DamageSources.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/DamageSources.java @@ -11,10 +11,10 @@ package de.ellpeck.actuallyadditions.mod.misc; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; -import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.LivingEntity; import net.minecraft.util.DamageSource; import net.minecraft.util.text.ITextComponent; -import net.minecraft.util.text.TextComponentTranslation; +import net.minecraft.util.text.TranslationTextComponent; public class DamageSources extends DamageSource { @@ -28,8 +28,8 @@ public class DamageSources extends DamageSource { } @Override - public ITextComponent getDeathMessage(EntityLivingBase entity) { + public ITextComponent getDeathMessage(LivingEntity entity) { String locTag = "death." + ActuallyAdditions.MODID + "." + this.damageType + "." + (entity.world.rand.nextInt(this.messageCount) + 1); - return new TextComponentTranslation(locTag, entity.getName()); + return new TranslationTextComponent(locTag, entity.getName()); } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/ISmileyCloudEasterEgg.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/ISmileyCloudEasterEgg.java index e8d8e1f0f..32c0de97a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/ISmileyCloudEasterEgg.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/ISmileyCloudEasterEgg.java @@ -1,24 +1,25 @@ -/* - * This file ("ISmileyCloudEasterEgg.java") is part of the Actually Additions mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2015-2017 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.misc.cloud; - -public interface ISmileyCloudEasterEgg { - - /** - * Extra rendering function - */ - void renderExtra(float f); - - /** - * The name the cloud has to have for this effect to occur - */ - String[] getTriggerNames(); -} +// TODO: [port] not used +///* +// * This file ("ISmileyCloudEasterEgg.java") is part of the Actually Additions mod for Minecraft. +// * It is created and owned by Ellpeck and distributed +// * under the Actually Additions License to be found at +// * http://ellpeck.de/actaddlicense +// * View the source code at https://github.com/Ellpeck/ActuallyAdditions +// * +// * © 2015-2017 Ellpeck +// */ +// +//package de.ellpeck.actuallyadditions.mod.misc.cloud; +// +//public interface ISmileyCloudEasterEgg { +// +// /** +// * Extra rendering function +// */ +// void renderExtra(float f); +// +// /** +// * The name the cloud has to have for this effect to occur +// */ +// String[] getTriggerNames(); +//} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/SmileyCloudEasterEggs.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/SmileyCloudEasterEggs.java index fb425f85c..2722c3cd3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/SmileyCloudEasterEggs.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/cloud/SmileyCloudEasterEggs.java @@ -1,523 +1,524 @@ -/* - * This file ("SmileyCloudEasterEggs.java") is part of the Actually Additions mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://ellpeck.de/actaddlicense - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2015-2017 Ellpeck - */ - -package de.ellpeck.actuallyadditions.mod.misc.cloud; - -import java.util.ArrayList; -import java.util.List; - -import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; -import de.ellpeck.actuallyadditions.mod.items.InitItems; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods; -import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; -import de.ellpeck.actuallyadditions.mod.util.AssetUtil; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; - -public final class SmileyCloudEasterEggs { - - public static final List CLOUD_STUFF = new ArrayList<>(); - - static { - //Glenthor - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "glenthor", "glenthorlp", "twoofeight" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(true, new ItemStack(Items.DYE, 1, 2)); - renderHeadBlock(InitBlocks.blockHeatCollector, 0, 5F); - } - }); - //Ellpeck - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "ellpeck", "ellopecko", "peck" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(InitItems.itemPhantomConnector)); - renderHeadBlock(InitBlocks.blockPhantomLiquiface, 0, 25F); - } - }); - //Tyrex - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "tyrex", "lord_tobinho", "tobinho" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(Items.FISHING_ROD)); - renderHoldingItem(true, new ItemStack(Items.FISH)); - } - }); - //Hose - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "dqmhose", "xdqmhose", "hose" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(Items.REEDS)); - renderHeadBlock(Blocks.TORCH, 0, 15F); - } - }); - //Tobi - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "jemx", "jemxx", "jemxxx", "spielertobi200" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(true, new ItemStack(Items.MILK_BUCKET)); - renderHeadBlock(Blocks.REDSTONE_LAMP, 0, 35F); - } - }); - //Vazkii - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "vazkii", "vaski", "waskie" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(true, new ItemStack(Items.DYE, 1, 15)); - renderHeadBlock(Blocks.RED_FLOWER, 5, 20F); - } - }); - //Kitty - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "kitty", "kiddy", "kittyvancat", "kittyvancatlp" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(true, new ItemStack(Items.FISH)); - renderHoldingItem(false, new ItemStack(Items.MILK_BUCKET)); - renderHeadBlock(Blocks.WOOL, 10, 15F); - } - }); - //Canitzp - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "canitz", "canitzp", "kannnichts", "kannnichtsp" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(Items.WOODEN_SWORD)); - renderHeadBlock(Blocks.CHEST, 0, 70F); - } - }); - //Lari - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "lari", "larixine", "xine", "laxi", "lachsirine", "lala", "lalilu" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(Items.IRON_HELMET)); - renderHeadBlock(InitBlocks.blockBlackLotus, 0, 28F); - } - }); - //RotesDing - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "rotesding", "dotesring" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(Items.MILK_BUCKET)); - renderHoldingItem(true, new ItemStack(Items.DYE, 1, 1)); - renderHeadBlock(Blocks.WOOL, 14, 18F); - } - }); - //Bande - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "bande", "bandelenth" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(Items.DIAMOND_PICKAXE)); - renderHeadBlock(Blocks.WOOL, 4, 18F); - } - }); - //Wolle - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "wolle", "wuitoi" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(Items.STRING)); - renderHeadBlock(Blocks.WOOL, 0, 18F); - } - }); - //Pakto - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "pakto", "paktosan", "paktosanlp" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(Items.DYE, 1, 9)); - renderHeadBlock(InitBlocks.blockColoredLampOn, 6, 18F); - } - }); - //Honka - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "honka", "honkalonka", "lonka", "lonki" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(InitItems.itemLeafBlowerAdvanced, 1, 9)); - renderHeadBlock(Blocks.HAY_BLOCK, 0, 74F); - } - }); - //Acid - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "acid", "acid_blues", "acidblues" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(InitItems.itemFoods, 1, TheFoods.PIZZA.ordinal())); - renderHeadBlock(Blocks.BOOKSHELF, 0, 27F); - } - }); - //Jasin - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "jasin", "jasindow" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(Items.WRITTEN_BOOK)); - renderHeadBlock(Blocks.WEB, 0, 56F); - } - }); - //ShadowNinjaCat - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "shadowninjacat", "ninja", "tl" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(Items.DIAMOND_SWORD)); - renderHeadBlock(Blocks.DIAMOND_BLOCK, 0, 26F); - } - }); - //NihonTiger - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "nihon", "nihontiger", "tiger" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(Items.STONE_PICKAXE)); - renderHoldingItem(true, new ItemStack(Items.POISONOUS_POTATO)); - renderHeadBlock(Blocks.GRAVEL, 0, 47F); - } - }); - //FrauBaerchen - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "fraubaerchen", "baerchen", "nina" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(Items.COOKIE)); - renderHoldingItem(true, new ItemStack(Items.PAPER)); - renderHeadBlock(Blocks.COAL_BLOCK, 0, 60F); - } - }); - //Diddi - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "0xdd", "didi", "diddi", "theultimatehose" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(true, new ItemStack(InitItems.itemDrill)); - renderHeadBlock(Blocks.REDSTONE_BLOCK, 0, 30F); - } - }); - //MineLoad - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "mineload", "miney", "loady", "mineyloady" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(InitItems.itemMagnetRing)); - renderHeadBlock(Blocks.CRAFTING_TABLE, 0, 35F); - } - }); - //Kilobyte (When I asked him if he liked the mod, he just looked at the code. Maybe he'll find this eventually.) - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "kilobyte", "kilo", "byte" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DRILL_CORE.ordinal())); - renderHeadBlock(Blocks.REDSTONE_ORE, 0, 80F); - } - }); - //XDjackieXD - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "jackie", "xdjackiexd", "xdjackie", "jackiexd" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(Items.ENCHANTED_BOOK)); - renderHeadBlock(InitBlocks.blockDirectionalBreaker, 0, 40F); - } - }); - //Little Lampi (I still can't get over it) - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "lampi", "littlelampi", "little lampi" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(Items.GLOWSTONE_DUST)); - renderHeadBlock(InitBlocks.blockColoredLampOn, 4, 40F); - } - }); - //AtomSponge - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "sponge", "atomsponge", "atom", "explosions", "explosion" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(Items.GUNPOWDER)); - renderHeadBlock(Blocks.SPONGE, 0, 20F); - } - }); - //Mattzimann - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "mattzimann", "mattziman", "matziman", "marzipan", "mattzi" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(InitItems.itemSwordEmerald)); - renderHeadBlock(InitBlocks.blockCoffeeMachine, 0, 35F); - } - }); - //Etho - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "etho", "ethoslab" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(Items.REDSTONE)); - renderHeadBlock(Blocks.REDSTONE_BLOCK, 0, 48F); - } - }); - //Direwolf20 - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "direwolf", "dire", "direwolf20", "dw20" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(Items.BONE)); - renderHeadBlock(Blocks.BONE_BLOCK, 0, 48F); - } - }); - //Jessassin - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "jessassin", "thejessassin" }; - } - - @Override - public void renderExtra(float f) { - renderHeadBlock(InitBlocks.blockLaserRelayItem, 0, 27F); - renderHoldingItem(false, new ItemStack(InitItems.itemLaserWrench)); - } - }); - //Biffa - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "biffa", "biffatech", "biffaplays", "biffa2001" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(InitItems.itemCoffee)); - } - }); - //Xisuma - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "xisuma", "xisumavoid" }; - } - - @Override - public void renderExtra(float f) { - renderHeadBlock(Blocks.REDSTONE_BLOCK, 0, 93F); - renderHoldingItem(false, new ItemStack(Items.ELYTRA)); - } - }); - //Welsknight - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "welsknight", "wels" }; - } - - @Override - public void renderExtra(float f) { - renderHeadBlock(Blocks.STONE_BRICK_STAIRS, 0, 10F); - renderHoldingItem(false, new ItemStack(Items.DIAMOND_PICKAXE)); - } - }); - //xbony2 - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "bony", "xbony", "xbony2" }; - } - - @Override - public void renderExtra(float f) { - renderHoldingItem(false, new ItemStack(InitItems.itemBooklet)); - renderHeadBlock(InitBlocks.blockSmileyCloud, 0, 13F); - } - }); - //MattaBase - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "themattabase", "mattabase", "matt", "mad" }; - } - - @Override - public void renderExtra(float f) { - renderHeadBlock(Blocks.WOOL, 13, 35F); - renderHoldingItem(false, new ItemStack(InitItems.itemSwordQuartz)); - renderHoldingItem(true, new ItemStack(Items.SHIELD)); - } - }); - //Cloudy - register(new ISmileyCloudEasterEgg() { - @Override - public String[] getTriggerNames() { - return new String[] { "cloudy", "cloudhunter" }; - } - - @Override - public void renderExtra(float f) { - renderHeadBlock(Blocks.REDSTONE_BLOCK, 0, 17F); - //other hand is for fapping - renderHoldingItem(true, new ItemStack(Items.BOW)); - } - }); - } - - private static void register(ISmileyCloudEasterEgg egg) { - CLOUD_STUFF.add(egg); - } - - private static void renderHoldingItem(boolean leftHand, ItemStack stack) { - GlStateManager.pushMatrix(); - GlStateManager.rotate(180F, 0F, 0F, 1F); - GlStateManager.rotate(90, 0, 1, 0); - GlStateManager.translate(-0.15, -1F, leftHand ? -0.525F : 0.525F); - GlStateManager.scale(0.75F, 0.75F, 0.75F); - - AssetUtil.renderItemInWorld(stack); - - GlStateManager.popMatrix(); - } - - private static void renderHeadBlock(Block block, int meta, float rotation) { - GlStateManager.pushMatrix(); - GlStateManager.disableLighting(); - GlStateManager.translate(-0.015F, 0.625F, 0.04F); - GlStateManager.scale(0.5F, 0.5F, 0.5F); - GlStateManager.rotate(180F, 1F, 0F, 0F); - GlStateManager.rotate(rotation, 0F, 1F, 0F); - - AssetUtil.renderBlockInWorld(block, meta); - - GlStateManager.enableLighting(); - GlStateManager.popMatrix(); - } -} +// TODO: [port] not used +///* +// * This file ("SmileyCloudEasterEggs.java") is part of the Actually Additions mod for Minecraft. +// * It is created and owned by Ellpeck and distributed +// * under the Actually Additions License to be found at +// * http://ellpeck.de/actaddlicense +// * View the source code at https://github.com/Ellpeck/ActuallyAdditions +// * +// * © 2015-2017 Ellpeck +// */ +// +//package de.ellpeck.actuallyadditions.mod.misc.cloud; +// +//import java.util.ArrayList; +//import java.util.List; +// +//import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +//import de.ellpeck.actuallyadditions.mod.items.InitItems; +//import de.ellpeck.actuallyadditions.mod.items.metalists.TheFoods; +//import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems; +//import de.ellpeck.actuallyadditions.mod.util.AssetUtil; +//import net.minecraft.block.Block; +//import net.minecraft.client.renderer.GlStateManager; +//import net.minecraft.init.Blocks; +//import net.minecraft.init.Items; +//import net.minecraft.item.ItemStack; +// +//public final class SmileyCloudEasterEggs { +// +// public static final List CLOUD_STUFF = new ArrayList<>(); +// +// static { +// //Glenthor +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "glenthor", "glenthorlp", "twoofeight" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(true, new ItemStack(Items.DYE, 1, 2)); +// renderHeadBlock(InitBlocks.blockHeatCollector, 0, 5F); +// } +// }); +// //Ellpeck +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "ellpeck", "ellopecko", "peck" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(InitItems.itemPhantomConnector)); +// renderHeadBlock(InitBlocks.blockPhantomLiquiface, 0, 25F); +// } +// }); +// //Tyrex +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "tyrex", "lord_tobinho", "tobinho" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(Items.FISHING_ROD)); +// renderHoldingItem(true, new ItemStack(Items.FISH)); +// } +// }); +// //Hose +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "dqmhose", "xdqmhose", "hose" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(Items.REEDS)); +// renderHeadBlock(Blocks.TORCH, 0, 15F); +// } +// }); +// //Tobi +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "jemx", "jemxx", "jemxxx", "spielertobi200" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(true, new ItemStack(Items.MILK_BUCKET)); +// renderHeadBlock(Blocks.REDSTONE_LAMP, 0, 35F); +// } +// }); +// //Vazkii +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "vazkii", "vaski", "waskie" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(true, new ItemStack(Items.DYE, 1, 15)); +// renderHeadBlock(Blocks.RED_FLOWER, 5, 20F); +// } +// }); +// //Kitty +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "kitty", "kiddy", "kittyvancat", "kittyvancatlp" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(true, new ItemStack(Items.FISH)); +// renderHoldingItem(false, new ItemStack(Items.MILK_BUCKET)); +// renderHeadBlock(Blocks.WOOL, 10, 15F); +// } +// }); +// //Canitzp +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "canitz", "canitzp", "kannnichts", "kannnichtsp" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(Items.WOODEN_SWORD)); +// renderHeadBlock(Blocks.CHEST, 0, 70F); +// } +// }); +// //Lari +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "lari", "larixine", "xine", "laxi", "lachsirine", "lala", "lalilu" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(Items.IRON_HELMET)); +// renderHeadBlock(InitBlocks.blockBlackLotus, 0, 28F); +// } +// }); +// //RotesDing +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "rotesding", "dotesring" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(Items.MILK_BUCKET)); +// renderHoldingItem(true, new ItemStack(Items.DYE, 1, 1)); +// renderHeadBlock(Blocks.WOOL, 14, 18F); +// } +// }); +// //Bande +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "bande", "bandelenth" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(Items.DIAMOND_PICKAXE)); +// renderHeadBlock(Blocks.WOOL, 4, 18F); +// } +// }); +// //Wolle +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "wolle", "wuitoi" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(Items.STRING)); +// renderHeadBlock(Blocks.WOOL, 0, 18F); +// } +// }); +// //Pakto +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "pakto", "paktosan", "paktosanlp" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(Items.DYE, 1, 9)); +// renderHeadBlock(InitBlocks.blockColoredLampOn, 6, 18F); +// } +// }); +// //Honka +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "honka", "honkalonka", "lonka", "lonki" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(InitItems.itemLeafBlowerAdvanced, 1, 9)); +// renderHeadBlock(Blocks.HAY_BLOCK, 0, 74F); +// } +// }); +// //Acid +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "acid", "acid_blues", "acidblues" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(InitItems.itemFoods, 1, TheFoods.PIZZA.ordinal())); +// renderHeadBlock(Blocks.BOOKSHELF, 0, 27F); +// } +// }); +// //Jasin +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "jasin", "jasindow" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(Items.WRITTEN_BOOK)); +// renderHeadBlock(Blocks.WEB, 0, 56F); +// } +// }); +// //ShadowNinjaCat +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "shadowninjacat", "ninja", "tl" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(Items.DIAMOND_SWORD)); +// renderHeadBlock(Blocks.DIAMOND_BLOCK, 0, 26F); +// } +// }); +// //NihonTiger +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "nihon", "nihontiger", "tiger" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(Items.STONE_PICKAXE)); +// renderHoldingItem(true, new ItemStack(Items.POISONOUS_POTATO)); +// renderHeadBlock(Blocks.GRAVEL, 0, 47F); +// } +// }); +// //FrauBaerchen +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "fraubaerchen", "baerchen", "nina" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(Items.COOKIE)); +// renderHoldingItem(true, new ItemStack(Items.PAPER)); +// renderHeadBlock(Blocks.COAL_BLOCK, 0, 60F); +// } +// }); +// //Diddi +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "0xdd", "didi", "diddi", "theultimatehose" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(true, new ItemStack(InitItems.itemDrill)); +// renderHeadBlock(Blocks.REDSTONE_BLOCK, 0, 30F); +// } +// }); +// //MineLoad +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "mineload", "miney", "loady", "mineyloady" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(InitItems.itemMagnetRing)); +// renderHeadBlock(Blocks.CRAFTING_TABLE, 0, 35F); +// } +// }); +// //Kilobyte (When I asked him if he liked the mod, he just looked at the code. Maybe he'll find this eventually.) +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "kilobyte", "kilo", "byte" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DRILL_CORE.ordinal())); +// renderHeadBlock(Blocks.REDSTONE_ORE, 0, 80F); +// } +// }); +// //XDjackieXD +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "jackie", "xdjackiexd", "xdjackie", "jackiexd" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(Items.ENCHANTED_BOOK)); +// renderHeadBlock(InitBlocks.blockDirectionalBreaker, 0, 40F); +// } +// }); +// //Little Lampi (I still can't get over it) +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "lampi", "littlelampi", "little lampi" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(Items.GLOWSTONE_DUST)); +// renderHeadBlock(InitBlocks.blockColoredLampOn, 4, 40F); +// } +// }); +// //AtomSponge +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "sponge", "atomsponge", "atom", "explosions", "explosion" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(Items.GUNPOWDER)); +// renderHeadBlock(Blocks.SPONGE, 0, 20F); +// } +// }); +// //Mattzimann +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "mattzimann", "mattziman", "matziman", "marzipan", "mattzi" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(InitItems.itemSwordEmerald)); +// renderHeadBlock(InitBlocks.blockCoffeeMachine, 0, 35F); +// } +// }); +// //Etho +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "etho", "ethoslab" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(Items.REDSTONE)); +// renderHeadBlock(Blocks.REDSTONE_BLOCK, 0, 48F); +// } +// }); +// //Direwolf20 +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "direwolf", "dire", "direwolf20", "dw20" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(Items.BONE)); +// renderHeadBlock(Blocks.BONE_BLOCK, 0, 48F); +// } +// }); +// //Jessassin +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "jessassin", "thejessassin" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHeadBlock(InitBlocks.blockLaserRelayItem, 0, 27F); +// renderHoldingItem(false, new ItemStack(InitItems.itemLaserWrench)); +// } +// }); +// //Biffa +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "biffa", "biffatech", "biffaplays", "biffa2001" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(InitItems.itemCoffee)); +// } +// }); +// //Xisuma +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "xisuma", "xisumavoid" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHeadBlock(Blocks.REDSTONE_BLOCK, 0, 93F); +// renderHoldingItem(false, new ItemStack(Items.ELYTRA)); +// } +// }); +// //Welsknight +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "welsknight", "wels" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHeadBlock(Blocks.STONE_BRICK_STAIRS, 0, 10F); +// renderHoldingItem(false, new ItemStack(Items.DIAMOND_PICKAXE)); +// } +// }); +// //xbony2 +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "bony", "xbony", "xbony2" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHoldingItem(false, new ItemStack(InitItems.itemBooklet)); +// renderHeadBlock(InitBlocks.blockSmileyCloud, 0, 13F); +// } +// }); +// //MattaBase +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "themattabase", "mattabase", "matt", "mad" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHeadBlock(Blocks.WOOL, 13, 35F); +// renderHoldingItem(false, new ItemStack(InitItems.itemSwordQuartz)); +// renderHoldingItem(true, new ItemStack(Items.SHIELD)); +// } +// }); +// //Cloudy +// register(new ISmileyCloudEasterEgg() { +// @Override +// public String[] getTriggerNames() { +// return new String[] { "cloudy", "cloudhunter" }; +// } +// +// @Override +// public void renderExtra(float f) { +// renderHeadBlock(Blocks.REDSTONE_BLOCK, 0, 17F); +// //other hand is for fapping +// renderHoldingItem(true, new ItemStack(Items.BOW)); +// } +// }); +// } +// +// private static void register(ISmileyCloudEasterEgg egg) { +// CLOUD_STUFF.add(egg); +// } +// +// private static void renderHoldingItem(boolean leftHand, ItemStack stack) { +// GlStateManager.pushMatrix(); +// GlStateManager.rotate(180F, 0F, 0F, 1F); +// GlStateManager.rotate(90, 0, 1, 0); +// GlStateManager.translate(-0.15, -1F, leftHand ? -0.525F : 0.525F); +// GlStateManager.scale(0.75F, 0.75F, 0.75F); +// +// AssetUtil.renderItemInWorld(stack); +// +// GlStateManager.popMatrix(); +// } +// +// private static void renderHeadBlock(Block block, int meta, float rotation) { +// GlStateManager.pushMatrix(); +// GlStateManager.disableLighting(); +// GlStateManager.translate(-0.015F, 0.625F, 0.04F); +// GlStateManager.scale(0.5F, 0.5F, 0.5F); +// GlStateManager.rotate(180F, 1F, 0F, 0F); +// GlStateManager.rotate(rotation, 0F, 1F, 0F); +// +// AssetUtil.renderBlockInWorld(block, meta); +// +// GlStateManager.enableLighting(); +// GlStateManager.popMatrix(); +// } +//} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/RenderSpecial.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/RenderSpecial.java index 39b3f9cf0..af6a861a8 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/RenderSpecial.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/special/RenderSpecial.java @@ -10,15 +10,12 @@ package de.ellpeck.actuallyadditions.mod.misc.special; +import com.mojang.blaze3d.platform.GlStateManager; import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.StackUtil; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.player.EnumPlayerModelParts; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; -import net.minecraft.util.math.Vec3d; public class RenderSpecial { diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/util/Help.java b/src/main/java/de/ellpeck/actuallyadditions/mod/util/Help.java new file mode 100644 index 000000000..703a6a828 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/util/Help.java @@ -0,0 +1,15 @@ +package de.ellpeck.actuallyadditions.mod.util; + +import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; +import net.minecraft.util.text.TranslationTextComponent; +import net.minecraftforge.fml.ForgeI18n; + +public class Help { + public static TranslationTextComponent Trans(String prefix, String suffix, Object... args) { + return new TranslationTextComponent(String.format("%s.%s.%s", prefix, ActuallyAdditions.MODID, suffix)); + } + + public static String TransI18n(String prefix, String suffix, Object... args) { + return ForgeI18n.parseFormat(String.format("%s.%s.%s", prefix, ActuallyAdditions.MODID, suffix), args); + } +}