diff --git a/MC18_notes.txt b/MC18_notes.txt index 244388b76..de9c28fb4 100644 --- a/MC18_notes.txt +++ b/MC18_notes.txt @@ -14,13 +14,14 @@ Anyways, vanilla removed it from their method so we follow suit. * Most things left untouched to make patches from upstream easier * Most uses of chunkcoordinates directly convert blockpos (THANK YOU VAZKII FOR USING THEM). Remove creation of extra instances since BlockPos'es are immutable and thus can be reused everywhere. -* Some really needed fields in EntityItem are private now. Reflection time :(. If this is a +* Some really needed fields in EntityItem are private now. Reflection time :( * Alfglass now just uses the vanilla random model selection system to choose a pattern. Some of your builds may look different. Unless someone figures out a way to use the old one * The alt textures will probably be a resource pack now to decrease complexity... sorry :/ The systems needed to dynamically switch out the textures like that is not worth just throwing them into a resource pack * Slabs are kinda janky if you look at them - Mojang made some extremely silly assumptions and we're going to have to go with them * Quartz stair textures may be assigned incorrectly - resource pack authors check me +* Glass pane inner faces are not getting culled -- Todo -- * JSON models for everything (tedious/med-hard) @@ -28,5 +29,4 @@ sorry :/ The systems needed to dynamically switch out the textures like that is * For rendering arbitrary icons (that DO NOT HAVE AN ITEM) in a 3D style (manaResource icons, etc.) - Sub to texture stitch and bake our own model there to use? - This remains the largest portion of what is left - - Where is the method to render an arbitrary baked model? -* ItemBlocks seem to merge subtypes (shift clicking storage blocks onto each other) \ No newline at end of file + - Where is the method to render an arbitrary baked model? \ No newline at end of file diff --git a/src/main/java/vazkii/botania/client/core/handler/ModelHandler.java b/src/main/java/vazkii/botania/client/core/handler/ModelHandler.java index 95f4be213..0e5979e28 100644 --- a/src/main/java/vazkii/botania/client/core/handler/ModelHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/ModelHandler.java @@ -291,7 +291,9 @@ public final class ModelHandler { } private static void registerPanes() { - + registerItemModel(ModFluffBlocks.alfglassPane); + registerItemModel(ModFluffBlocks.bifrostPane); + registerItemModel(ModFluffBlocks.managlassPane); } private static void registerPylons() { diff --git a/src/main/java/vazkii/botania/client/render/tile/RenderTileLightRelay.java b/src/main/java/vazkii/botania/client/render/tile/RenderTileLightRelay.java index f6d388395..4e009edbf 100644 --- a/src/main/java/vazkii/botania/client/render/tile/RenderTileLightRelay.java +++ b/src/main/java/vazkii/botania/client/render/tile/RenderTileLightRelay.java @@ -76,7 +76,7 @@ public class RenderTileLightRelay extends TileEntitySpecialRenderer { float f6 = 0.25F; p_77026_1_.getWorldRenderer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); - p_77026_1_.getWorldRenderer().putNormal(0.0F, 1.0F, 0.0F); + //p_77026_1_.getWorldRenderer().putNormal(0.0F, 1.0F, 0.0F); //p_77026_1_.getWorldRenderer().setBrightness(240); p_77026_1_.getWorldRenderer().pos(0.0F - f5, 0.0F - f6, 0.0D).tex(f, f3).endVertex(); p_77026_1_.getWorldRenderer().pos(f4 - f5, 0.0F - f6, 0.0D).tex(f1, f3).endVertex(); diff --git a/src/main/java/vazkii/botania/common/block/BlockGhostRail.java b/src/main/java/vazkii/botania/common/block/BlockGhostRail.java index a2f0449a9..52b7311e0 100644 --- a/src/main/java/vazkii/botania/common/block/BlockGhostRail.java +++ b/src/main/java/vazkii/botania/common/block/BlockGhostRail.java @@ -12,7 +12,11 @@ package vazkii.botania.common.block; import net.minecraft.block.Block; import net.minecraft.block.BlockRailBase; +import net.minecraft.block.BlockRailPowered; import net.minecraft.block.properties.IProperty; +import net.minecraft.block.properties.PropertyEnum; +import net.minecraft.block.state.BlockState; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; @@ -34,6 +38,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; public class BlockGhostRail extends BlockRailBase implements ILexiconable { + public static final PropertyEnum SHAPE = BlockRailPowered.SHAPE; private static final String TAG_FLOAT_TICKS = "Botania_FloatTicks"; public BlockGhostRail() { @@ -41,6 +46,22 @@ public class BlockGhostRail extends BlockRailBase implements ILexiconable { setCreativeTab(BotaniaCreativeTab.INSTANCE); MinecraftForge.EVENT_BUS.register(this); setUnlocalizedName(LibBlockNames.GHOST_RAIL); + setDefaultState(blockState.getBaseState().withProperty(SHAPE, EnumRailDirection.NORTH_SOUTH)); + } + + @Override + public BlockState createBlockState() { + return new BlockState(this, SHAPE); + } + + @Override + public int getMetaFromState(IBlockState state) { + return state.getValue(SHAPE).getMetadata(); + } + + @Override + public IBlockState getStateFromMeta(int meta) { + return getDefaultState().withProperty(SHAPE, EnumRailDirection.byMetadata(meta)); } @Override @@ -87,7 +108,7 @@ public class BlockGhostRail extends BlockRailBase implements ILexiconable { } @Override - public IProperty getShapeProperty() { - return null; // todo 1.8 ?? + public IProperty getShapeProperty() { + return BlockRailPowered.SHAPE; } } diff --git a/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower.java b/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower.java index 6148fe2b2..7493e23bb 100644 --- a/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower.java +++ b/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower.java @@ -212,7 +212,7 @@ public abstract class BlockModDoubleFlower extends BlockBush implements IGrowabl @Override public void randomDisplayTick(World par1World, BlockPos pos, IBlockState state, Random par5Random) { - int hex = ((EnumDyeColor) state.getValue(BotaniaStateProps.COLOR)).getMapColor().colorValue; + int hex = ((EnumDyeColor) state.getValue(second ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1)).getMapColor().colorValue; int r = (hex & 0xFF0000) >> 16; int g = (hex & 0xFF00) >> 8; int b = (hex & 0xFF); diff --git a/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower1.java b/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower1.java index 350af4c3f..634f644ae 100644 --- a/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower1.java +++ b/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower1.java @@ -31,6 +31,6 @@ public class BlockModDoubleFlower1 extends BlockModDoubleFlower { public IBlockState getStateFromMeta(int meta) { BlockDoublePlant.EnumBlockHalf half = (meta & 8) > 0 ? BlockDoublePlant.EnumBlockHalf.UPPER : BlockDoublePlant.EnumBlockHalf.LOWER; meta &= -9; - return getDefaultState().withProperty(HALF, half).withProperty(BotaniaStateProps.DOUBLEFLOWER_VARIANT_2, EnumDyeColor.byMetadata(meta)); + return getDefaultState().withProperty(HALF, half).withProperty(BotaniaStateProps.DOUBLEFLOWER_VARIANT_1, EnumDyeColor.byMetadata(meta)); } } diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockBuriedPetals.java b/src/main/java/vazkii/botania/common/block/decor/BlockBuriedPetals.java index 8b98081c4..a3e45b9d2 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockBuriedPetals.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockBuriedPetals.java @@ -69,6 +69,6 @@ public class BlockBuriedPetals extends BlockModFlower { @Override public int getRenderType() { - return 0; + return -1; } } diff --git a/src/main/java/vazkii/botania/common/block/decor/panes/BlockAlfglassPane.java b/src/main/java/vazkii/botania/common/block/decor/panes/BlockAlfglassPane.java index 081d8e7da..256471165 100644 --- a/src/main/java/vazkii/botania/common/block/decor/panes/BlockAlfglassPane.java +++ b/src/main/java/vazkii/botania/common/block/decor/panes/BlockAlfglassPane.java @@ -10,6 +10,7 @@ */ package vazkii.botania.common.block.decor.panes; +import net.minecraft.util.EnumWorldBlockLayer; import vazkii.botania.common.block.ModBlocks; public class BlockAlfglassPane extends BlockModPane { @@ -18,4 +19,8 @@ public class BlockAlfglassPane extends BlockModPane { super(ModBlocks.elfGlass); } + @Override + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.TRANSLUCENT; + } } diff --git a/src/main/java/vazkii/botania/common/block/decor/panes/BlockBifrostPane.java b/src/main/java/vazkii/botania/common/block/decor/panes/BlockBifrostPane.java index 536421cb7..13cde90b3 100644 --- a/src/main/java/vazkii/botania/common/block/decor/panes/BlockBifrostPane.java +++ b/src/main/java/vazkii/botania/common/block/decor/panes/BlockBifrostPane.java @@ -10,6 +10,7 @@ */ package vazkii.botania.common.block.decor.panes; +import net.minecraft.util.EnumWorldBlockLayer; import vazkii.botania.common.block.ModBlocks; public class BlockBifrostPane extends BlockModPane { @@ -18,4 +19,8 @@ public class BlockBifrostPane extends BlockModPane { super(ModBlocks.bifrostPerm); } + @Override + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.TRANSLUCENT; + } } diff --git a/src/main/java/vazkii/botania/common/block/decor/panes/BlockManaglassPane.java b/src/main/java/vazkii/botania/common/block/decor/panes/BlockManaglassPane.java index d509b38b9..20c8e69ff 100644 --- a/src/main/java/vazkii/botania/common/block/decor/panes/BlockManaglassPane.java +++ b/src/main/java/vazkii/botania/common/block/decor/panes/BlockManaglassPane.java @@ -10,6 +10,7 @@ */ package vazkii.botania.common.block.decor.panes; +import net.minecraft.util.EnumWorldBlockLayer; import vazkii.botania.common.block.ModBlocks; public class BlockManaglassPane extends BlockModPane { @@ -18,4 +19,9 @@ public class BlockManaglassPane extends BlockModPane { super(ModBlocks.manaGlass); } + @Override + public EnumWorldBlockLayer getBlockLayer() { + return EnumWorldBlockLayer.TRANSLUCENT; + } + } diff --git a/src/main/java/vazkii/botania/common/block/decor/panes/BlockModPane.java b/src/main/java/vazkii/botania/common/block/decor/panes/BlockModPane.java index 5e3c78f87..b086bbf39 100644 --- a/src/main/java/vazkii/botania/common/block/decor/panes/BlockModPane.java +++ b/src/main/java/vazkii/botania/common/block/decor/panes/BlockModPane.java @@ -49,11 +49,6 @@ public class BlockModPane extends BlockPane { return false; } - @Override - public int getRenderType() { - return 18; - } - @Override public boolean canPaneConnectTo(IBlockAccess world, BlockPos pos, EnumFacing dir) { Block block = world.getBlockState(pos).getBlock(); diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockBellows.java b/src/main/java/vazkii/botania/common/block/mana/BlockBellows.java index d87acfc5b..01a7f7a83 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockBellows.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockBellows.java @@ -52,12 +52,12 @@ public class BlockBellows extends BlockModContainer implements ILexiconable { @Override public int getMetaFromState(IBlockState state) { - return ((EnumFacing) state.getValue(BotaniaStateProps.CARDINALS)).getHorizontalIndex(); + return ((EnumFacing) state.getValue(BotaniaStateProps.CARDINALS)).getIndex(); } @Override public IBlockState getStateFromMeta(int meta) { - return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.getHorizontal(meta)); + return getDefaultState().withProperty(BotaniaStateProps.CARDINALS, EnumFacing.getFront(meta)); } @Override diff --git a/src/main/java/vazkii/botania/common/block/tile/TileSpawnerClaw.java b/src/main/java/vazkii/botania/common/block/tile/TileSpawnerClaw.java index 1ee89bdd1..26e66a514 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileSpawnerClaw.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileSpawnerClaw.java @@ -41,7 +41,7 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver, ITickable private static final Field spawnDelay = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.SPAWN_DELAY); private static final Field mobRotation = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.MOB_ROTATION); private static final Field prevMobRotation = ReflectionHelper.findField(MobSpawnerBaseLogic.class, LibObfuscation.PREV_MOB_ROTATION); - private static final Method spawnNewEntity = ReflectionHelper.findMethod(MobSpawnerBaseLogic.class, null, LibObfuscation.SPAWN_NEW_ENTITY); + private static final Method spawnNewEntity = ReflectionHelper.findMethod(MobSpawnerBaseLogic.class, null, LibObfuscation.SPAWN_NEW_ENTITY, Entity.class, boolean.class); private static final Method getEntityNameToSpawn = ReflectionHelper.findMethod(MobSpawnerBaseLogic.class, null, LibObfuscation.GET_ENTITY_TO_SPAWN); @Override diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TileBellows.java b/src/main/java/vazkii/botania/common/block/tile/mana/TileBellows.java index c647b6298..97a850de3 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TileBellows.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TileBellows.java @@ -116,8 +116,9 @@ public class TileBellows extends TileMod implements ITickable { } public TileEntity getLinkedTile() { - EnumFacing side = ((EnumFacing) worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.CARDINALS)); - return worldObj.getTileEntity(getPos().offset(side)); + return null; +// EnumFacing side = ((EnumFacing) worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.CARDINALS)); +// return worldObj.getTileEntity(getPos().offset(side)); } @Override diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TileRFGenerator.java b/src/main/java/vazkii/botania/common/block/tile/mana/TileRFGenerator.java index a9f713222..d75fdfea6 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TileRFGenerator.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TileRFGenerator.java @@ -15,6 +15,7 @@ import net.minecraft.util.ITickable; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import net.minecraftforge.fml.common.Loader; import vazkii.botania.api.mana.IManaReceiver; import vazkii.botania.common.block.tile.TileMod; import cofh.api.energy.IEnergyConnection; @@ -47,9 +48,8 @@ public class TileRFGenerator extends TileMod implements IManaReceiver, IEnergyCo } @Override - @Optional.Method(modid = "CoFHAPI|energy") public void update() { - if(!worldObj.isRemote) { + if(!worldObj.isRemote && Loader.isModLoaded("CoFHAPI|energy")) { if(deadCache) reCache(); diff --git a/src/main/resources/assets/botania/blockstates/bifrostPermPane.json b/src/main/resources/assets/botania/blockstates/bifrostPermPane.json new file mode 100644 index 000000000..14b6a2719 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/bifrostPermPane.json @@ -0,0 +1,34 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "edge": "botania:blocks/bifrostPermPane", + "pane": "botania:blocks/bifrost" + } + }, + "variants": { + "east=false,north=false,south=false,west=false": { "model": "minecraft:pane_nsew" }, + "east=false,north=true,south=false,west=false": { "model": "minecraft:pane_n" }, + "east=true,north=false,south=false,west=false": { "model": "minecraft:pane_n", "y": 90 }, + "east=false,north=false,south=true,west=false": { "model": "minecraft:pane_n", "y": 180 }, + "east=false,north=false,south=false,west=true": { "model": "minecraft:pane_n", "y": 270 }, + "east=true,north=true,south=false,west=false": { "model": "minecraft:pane_ne" }, + "east=true,north=false,south=true,west=false": { "model": "minecraft:pane_ne", "y": 90 }, + "east=false,north=false,south=true,west=true": { "model": "minecraft:pane_ne", "y": 180 }, + "east=false,north=true,south=false,west=true": { "model": "minecraft:pane_ne", "y": 270 }, + "east=false,north=true,south=true,west=false": { "model": "minecraft:pane_ns" }, + "east=true,north=false,south=false,west=true": { "model": "minecraft:pane_ns", "y": 90 }, + "east=true,north=true,south=true,west=false": { "model": "minecraft:pane_nse" }, + "east=true,north=false,south=true,west=true": { "model": "minecraft:pane_nse", "y": 90 }, + "east=false,north=true,south=true,west=true": { "model": "minecraft:pane_nse", "y": 180 }, + "east=true,north=true,south=false,west=true": { "model": "minecraft:pane_nse", "y": 270 }, + "east=true,north=true,south=true,west=true": { "model": "minecraft:pane_nsew" }, + "inventory": [{ + "transform": "forge:default-item", + "model": "builtin/generated", + "textures": { + "layer0": "botania:blocks/bifrost" + } + }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/elfGlassPane.json b/src/main/resources/assets/botania/blockstates/elfGlassPane.json new file mode 100644 index 000000000..4877ed756 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/elfGlassPane.json @@ -0,0 +1,34 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "edge": "botania:blocks/elfGlassPane", + "pane": "botania:blocks/elfGlass" + } + }, + "variants": { + "east=false,north=false,south=false,west=false": { "model": "minecraft:pane_nsew" }, + "east=false,north=true,south=false,west=false": { "model": "minecraft:pane_n" }, + "east=true,north=false,south=false,west=false": { "model": "minecraft:pane_n", "y": 90 }, + "east=false,north=false,south=true,west=false": { "model": "minecraft:pane_n", "y": 180 }, + "east=false,north=false,south=false,west=true": { "model": "minecraft:pane_n", "y": 270 }, + "east=true,north=true,south=false,west=false": { "model": "minecraft:pane_ne" }, + "east=true,north=false,south=true,west=false": { "model": "minecraft:pane_ne", "y": 90 }, + "east=false,north=false,south=true,west=true": { "model": "minecraft:pane_ne", "y": 180 }, + "east=false,north=true,south=false,west=true": { "model": "minecraft:pane_ne", "y": 270 }, + "east=false,north=true,south=true,west=false": { "model": "minecraft:pane_ns" }, + "east=true,north=false,south=false,west=true": { "model": "minecraft:pane_ns", "y": 90 }, + "east=true,north=true,south=true,west=false": { "model": "minecraft:pane_nse" }, + "east=true,north=false,south=true,west=true": { "model": "minecraft:pane_nse", "y": 90 }, + "east=false,north=true,south=true,west=true": { "model": "minecraft:pane_nse", "y": 180 }, + "east=true,north=true,south=false,west=true": { "model": "minecraft:pane_nse", "y": 270 }, + "east=true,north=true,south=true,west=true": { "model": "minecraft:pane_nsew" }, + "inventory": [{ + "transform": "forge:default-item", + "model": "builtin/generated", + "textures": { + "layer0": "botania:blocks/elfGlass" + } + }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/manaGlassPane.json b/src/main/resources/assets/botania/blockstates/manaGlassPane.json new file mode 100644 index 000000000..27be01075 --- /dev/null +++ b/src/main/resources/assets/botania/blockstates/manaGlassPane.json @@ -0,0 +1,34 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "edge": "botania:blocks/manaGlassPane", + "pane": "botania:blocks/manaGlass" + } + }, + "variants": { + "east=false,north=false,south=false,west=false": { "model": "minecraft:pane_nsew" }, + "east=false,north=true,south=false,west=false": { "model": "minecraft:pane_n" }, + "east=true,north=false,south=false,west=false": { "model": "minecraft:pane_n", "y": 90 }, + "east=false,north=false,south=true,west=false": { "model": "minecraft:pane_n", "y": 180 }, + "east=false,north=false,south=false,west=true": { "model": "minecraft:pane_n", "y": 270 }, + "east=true,north=true,south=false,west=false": { "model": "minecraft:pane_ne" }, + "east=true,north=false,south=true,west=false": { "model": "minecraft:pane_ne", "y": 90 }, + "east=false,north=false,south=true,west=true": { "model": "minecraft:pane_ne", "y": 180 }, + "east=false,north=true,south=false,west=true": { "model": "minecraft:pane_ne", "y": 270 }, + "east=false,north=true,south=true,west=false": { "model": "minecraft:pane_ns" }, + "east=true,north=false,south=false,west=true": { "model": "minecraft:pane_ns", "y": 90 }, + "east=true,north=true,south=true,west=false": { "model": "minecraft:pane_nse" }, + "east=true,north=false,south=true,west=true": { "model": "minecraft:pane_nse", "y": 90 }, + "east=false,north=true,south=true,west=true": { "model": "minecraft:pane_nse", "y": 180 }, + "east=true,north=true,south=false,west=true": { "model": "minecraft:pane_nse", "y": 270 }, + "east=true,north=true,south=true,west=true": { "model": "minecraft:pane_nsew" }, + "inventory": [{ + "transform": "forge:default-item", + "model": "builtin/generated", + "textures": { + "layer0": "botania:blocks/manaGlass" + } + }] + } +} diff --git a/src/main/resources/assets/botania/blockstates/reedBlock0Stairs.json b/src/main/resources/assets/botania/blockstates/reedBlock0Stairs.json index 8d24b4c7b..d86dfd521 100644 --- a/src/main/resources/assets/botania/blockstates/reedBlock0Stairs.json +++ b/src/main/resources/assets/botania/blockstates/reedBlock0Stairs.json @@ -17,7 +17,7 @@ "facing=south,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, "facing=north,half=bottom,shape=outer_right": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, "facing=east,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 270, "uvlock": true }, - "facing=west,half=bottom,shape=outer_left": { "model": "mdinecraft:outer_stairs", "y": 90, "uvlock": true }, + "facing=west,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 90, "uvlock": true }, "facing=south,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs" }, "facing=north,half=bottom,shape=outer_left": { "model": "minecraft:outer_stairs", "y": 180, "uvlock": true }, "facing=east,half=bottom,shape=inner_right": { "model": "minecraft:inner_stairs" },