From c1744f00e013edebe4f4eee210c54326e8e17fcb Mon Sep 17 00:00:00 2001 From: RainWarrior Date: Tue, 1 Mar 2016 17:59:58 +0300 Subject: [PATCH] Updated various block model patches. --- .../block/model/FaceBakery.java.patch | 93 +++++++++++++ .../block/model/IBakedModel.java.patch | 12 ++ .../model/ItemCameraTransforms.java.patch | 35 ++++- .../block/model/ModelBakery.java.patch | 107 ++++++++++++++ .../block/model/ModelManager.java.patch | 5 +- .../block/model/ModelRotation.java.patch | 8 +- .../renderer/block/model/Variant.java.patch | 20 +++ .../block/statemap/StateMap.java.patch | 11 ++ .../block/model/FaceBakery.java.patch.rej | 70 ---------- .../model/ModelBlockDefinition.java.patch.rej | 19 --- .../block/statemap/StateMap.java.patch.rej | 10 -- .../model/IBakedModel.java.patch.rej | 8 -- .../model/ModelBakery.java.patch.rej | 131 ------------------ src/main/resources/forge.exc | 10 +- 14 files changed, 286 insertions(+), 253 deletions(-) create mode 100644 patches.mcp/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch create mode 100644 patches.mcp/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java.patch create mode 100644 patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java.patch rename rejects/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch.rej => patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java.patch (77%) rename rejects/minecraft/net/minecraft/client/resources/model/ModelRotation.java.patch.rej => patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java.patch (81%) create mode 100644 patches.mcp/minecraft/net/minecraft/client/renderer/block/model/Variant.java.patch create mode 100644 patches.mcp/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch delete mode 100644 rejects/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch.rej delete mode 100644 rejects/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch.rej delete mode 100644 rejects/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch.rej delete mode 100644 rejects/minecraft/net/minecraft/client/resources/model/IBakedModel.java.patch.rej delete mode 100644 rejects/minecraft/net/minecraft/client/resources/model/ModelBakery.java.patch.rej diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch new file mode 100644 index 000000000..1b04f7810 --- /dev/null +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch @@ -0,0 +1,93 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java +@@ -48,14 +48,20 @@ + + public BakedQuad makeBakedQuad(Vector3f posFrom, Vector3f posTo, BlockPartFace face, TextureAtlasSprite sprite, EnumFacing facing, ModelRotation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) + { ++ return makeBakedQuad(posFrom, posTo, face, sprite, facing, (net.minecraftforge.client.model.ITransformation)modelRotationIn, partRotation, uvLocked, shade); ++ } ++ ++ public BakedQuad makeBakedQuad(Vector3f posFrom, Vector3f posTo, BlockPartFace face, TextureAtlasSprite sprite, EnumFacing facing, net.minecraftforge.client.model.ITransformation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) ++ { + BlockFaceUV blockfaceuv = face.blockFaceUV; + + if (uvLocked) + { +- blockfaceuv = this.func_188010_a(face.blockFaceUV, facing, modelRotationIn); ++ // TODO fix uvlock for custom rotations ++ //blockfaceuv = this.func_188010_a(face.blockFaceUV, facing, modelRotationIn); + } + +- int[] aint = this.func_188012_a(blockfaceuv, sprite, facing, this.getPositionsDiv16(posFrom, posTo), modelRotationIn, partRotation, shade); ++ int[] aint = this.makeQuadVertexData(blockfaceuv, sprite, facing, this.getPositionsDiv16(posFrom, posTo), modelRotationIn, partRotation, shade); + EnumFacing enumfacing = getFacingFromVertexData(aint); + + if (partRotation == null) +@@ -63,6 +69,7 @@ + this.func_178408_a(aint, enumfacing); + } + ++ net.minecraftforge.client.ForgeHooksClient.fillNormal(aint, enumfacing); + return new BakedQuad(aint, face.tintIndex, enumfacing, sprite); + } + +@@ -73,11 +80,16 @@ + + private int[] func_188012_a(BlockFaceUV p_188012_1_, TextureAtlasSprite p_188012_2_, EnumFacing p_188012_3_, float[] p_188012_4_, ModelRotation p_188012_5_, BlockPartRotation p_188012_6_, boolean p_188012_7_) + { ++ return makeQuadVertexData(p_188012_1_, p_188012_2_, p_188012_3_, p_188012_4_, (net.minecraftforge.client.model.ITransformation)p_188012_5_, p_188012_6_, p_188012_7_); ++ } ++ ++ private int[] makeQuadVertexData(BlockFaceUV p_188012_1_, TextureAtlasSprite p_188012_2_, EnumFacing p_188012_3_, float[] p_188012_4_, net.minecraftforge.client.model.ITransformation p_188012_5_, BlockPartRotation p_188012_6_, boolean p_188012_7_) ++ { + int[] aint = new int[28]; + + for (int i = 0; i < 4; ++i) + { +- this.func_188015_a(aint, i, p_188012_3_, p_188012_1_, p_188012_4_, p_188012_2_, p_188012_5_, p_188012_6_, p_188012_7_); ++ this.fillVertexData(aint, i, p_188012_3_, p_188012_1_, p_188012_4_, p_188012_2_, p_188012_5_, p_188012_6_, p_188012_7_); + } + + return aint; +@@ -123,12 +135,17 @@ + + private void func_188015_a(int[] p_188015_1_, int p_188015_2_, EnumFacing p_188015_3_, BlockFaceUV p_188015_4_, float[] p_188015_5_, TextureAtlasSprite p_188015_6_, ModelRotation p_188015_7_, BlockPartRotation p_188015_8_, boolean p_188015_9_) + { +- EnumFacing enumfacing = p_188015_7_.rotateFace(p_188015_3_); ++ fillVertexData(p_188015_1_, p_188015_2_, p_188015_3_, p_188015_4_, p_188015_5_, p_188015_6_, (net.minecraftforge.client.model.ITransformation)p_188015_7_, p_188015_8_, p_188015_9_); ++ } ++ ++ private void fillVertexData(int[] p_188015_1_, int p_188015_2_, EnumFacing p_188015_3_, BlockFaceUV p_188015_4_, float[] p_188015_5_, TextureAtlasSprite p_188015_6_, net.minecraftforge.client.model.ITransformation p_188015_7_, BlockPartRotation p_188015_8_, boolean p_188015_9_) ++ { ++ EnumFacing enumfacing = p_188015_7_.rotate(p_188015_3_); + int i = p_188015_9_ ? this.getFaceShadeColor(enumfacing) : -1; + EnumFaceDirection.VertexInformation enumfacedirection$vertexinformation = EnumFaceDirection.getFacing(p_188015_3_).func_179025_a(p_188015_2_); + Vector3f vector3f = new Vector3f(p_188015_5_[enumfacedirection$vertexinformation.field_179184_a], p_188015_5_[enumfacedirection$vertexinformation.field_179182_b], p_188015_5_[enumfacedirection$vertexinformation.field_179183_c]); + this.func_178407_a(vector3f, p_188015_8_); +- int j = this.func_188011_a(vector3f, p_188015_3_, p_188015_2_, p_188015_7_); ++ int j = this.rotateVertex(vector3f, p_188015_3_, p_188015_2_, p_188015_7_); + this.storeVertexData(p_188015_1_, j, p_188015_2_, vector3f, i, p_188015_6_, p_188015_4_); + } + +@@ -189,14 +206,19 @@ + + public int func_188011_a(Vector3f p_188011_1_, EnumFacing p_188011_2_, int p_188011_3_, ModelRotation p_188011_4_) + { ++ return rotateVertex(p_188011_1_, p_188011_2_, p_188011_3_, (net.minecraftforge.client.model.ITransformation)p_188011_4_); ++ } ++ ++ public int rotateVertex(Vector3f p_188011_1_, EnumFacing p_188011_2_, int p_188011_3_, net.minecraftforge.client.model.ITransformation p_188011_4_) ++ { + if (p_188011_4_ == ModelRotation.X0_Y0) + { + return p_188011_3_; + } + else + { +- this.rotateScale(p_188011_1_, new Vector3f(0.5F, 0.5F, 0.5F), p_188011_4_.getMatrix4d(), new Vector3f(1.0F, 1.0F, 1.0F)); +- return p_188011_4_.rotateVertex(p_188011_2_, p_188011_3_); ++ net.minecraftforge.client.ForgeHooksClient.transform(p_188011_1_, p_188011_4_.getMatrix()); ++ return p_188011_4_.rotate(p_188011_2_, p_188011_3_); + } + } + diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java.patch new file mode 100644 index 000000000..552a4b1c6 --- /dev/null +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java.patch @@ -0,0 +1,12 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/IBakedModel.java +@@ -20,7 +20,9 @@ + + TextureAtlasSprite getParticleTexture(); + ++ @Deprecated + ItemCameraTransforms getItemCameraTransforms(); + ++ @Deprecated + ItemOverrideList func_188617_f(); + } diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch index fd1bef036..44ff0e848 100644 --- a/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java.patch @@ -1,6 +1,6 @@ --- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java +++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ItemCameraTransforms.java -@@ -12,7 +12,11 @@ +@@ -12,10 +12,13 @@ import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.util.vector.Quaternion; @@ -8,11 +8,38 @@ + * @deprecated use {@link net.minecraftforge.client.model.IPerspectiveAwareModel} instead + */ @SideOnly(Side.CLIENT) -+@Deprecated public class ItemCameraTransforms { - public static final ItemCameraTransforms DEFAULT = new ItemCameraTransforms(); -@@ -169,7 +173,7 @@ +- public static final ItemCameraTransforms DEFAULT = new ItemCameraTransforms(); ++ public static final ItemCameraTransforms DEFAULT = new ItemCameraTransforms(); + public static float field_181690_b = 0.0F; + public static float field_181691_c = 0.0F; + public static float field_181692_d = 0.0F; +@@ -39,6 +42,7 @@ + this(ItemTransformVec3f.DEFAULT, ItemTransformVec3f.DEFAULT, ItemTransformVec3f.DEFAULT, ItemTransformVec3f.DEFAULT, ItemTransformVec3f.DEFAULT, ItemTransformVec3f.DEFAULT, ItemTransformVec3f.DEFAULT, ItemTransformVec3f.DEFAULT); + } + ++ @Deprecated + public ItemCameraTransforms(ItemCameraTransforms p_i46443_1_) + { + this.field_188036_k = p_i46443_1_.field_188036_k; +@@ -51,6 +55,7 @@ + this.fixed = p_i46443_1_.fixed; + } + ++ @Deprecated + public ItemCameraTransforms(ItemTransformVec3f p_i46569_1_, ItemTransformVec3f p_i46569_2_, ItemTransformVec3f p_i46569_3_, ItemTransformVec3f p_i46569_4_, ItemTransformVec3f p_i46569_5_, ItemTransformVec3f p_i46569_6_, ItemTransformVec3f p_i46569_7_, ItemTransformVec3f p_i46569_8_) + { + this.field_188036_k = p_i46569_1_; +@@ -103,6 +108,7 @@ + return new Quaternion(f3 * f6 * f8 + f4 * f5 * f7, f4 * f5 * f8 - f3 * f6 * f7, f3 * f5 * f8 + f4 * f6 * f7, f4 * f6 * f8 - f3 * f5 * f7); + } + ++ @Deprecated + public ItemTransformVec3f getTransform(ItemCameraTransforms.TransformType p_181688_1_) + { + switch (p_181688_1_) +@@ -169,7 +175,7 @@ } @SideOnly(Side.CLIENT) diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java.patch new file mode 100644 index 000000000..430b1227d --- /dev/null +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java.patch @@ -0,0 +1,107 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ModelBakery.java +@@ -132,7 +132,7 @@ + { + if (!modelblockdefinition.func_188002_b()) + { +- LOGGER.warn("Unable to load variant: " + modelresourcelocation.getVariant() + " from " + modelresourcelocation); ++ LOGGER.warn("Unable to load variant: " + modelresourcelocation.getVariant() + " from " + modelresourcelocation, var12); + } + } + } +@@ -370,6 +370,7 @@ + + private void registerVariantNames() + { ++ this.variantNames.clear(); //FML clear this to prevent double ups. + this.variantNames.put(Item.getItemFromBlock(Blocks.stone), Lists.newArrayList(new String[] {"stone", "granite", "granite_smooth", "diorite", "diorite_smooth", "andesite", "andesite_smooth"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.dirt), Lists.newArrayList(new String[] {"dirt", "coarse_dirt", "podzol"})); + this.variantNames.put(Item.getItemFromBlock(Blocks.planks), Lists.newArrayList(new String[] {"oak_planks", "spruce_planks", "birch_planks", "jungle_planks", "acacia_planks", "dark_oak_planks"})); +@@ -413,6 +414,10 @@ + this.variantNames.put(Item.getItemFromBlock(Blocks.oak_fence), Lists.newArrayList(new String[] {"oak_fence"})); + this.variantNames.put(Items.oak_door, Lists.newArrayList(new String[] {"oak_door"})); + this.variantNames.put(Items.boat, Lists.newArrayList(new String[] {"oak_boat"})); ++ for (Entry, Set> e : customVariantNames.entrySet()) ++ { ++ this.variantNames.put(e.getKey().get(), Lists.newArrayList(e.getValue().iterator())); ++ } + } + + private List getVariantNames(Item p_177596_1_) +@@ -429,7 +434,7 @@ + + private ResourceLocation getItemLocation(String p_177583_1_) + { +- ResourceLocation resourcelocation = new ResourceLocation(p_177583_1_); ++ ResourceLocation resourcelocation = new ResourceLocation(p_177583_1_.replaceAll("#.*", "")); + return new ResourceLocation(resourcelocation.getResourceDomain(), "item/" + resourcelocation.getResourcePath()); + } + +@@ -536,7 +541,7 @@ + for (Entry entry : this.itemLocations.entrySet()) + { + ResourceLocation resourcelocation = (ResourceLocation)entry.getValue(); +- ModelResourceLocation modelresourcelocation = new ModelResourceLocation((String)entry.getKey(), "inventory"); ++ ModelResourceLocation modelresourcelocation = net.minecraftforge.client.model.ModelLoader.getInventoryVariant(entry.getKey()); + ModelBlock modelblock = (ModelBlock)this.models.get(resourcelocation); + + if (modelblock != null && modelblock.isResolved()) +@@ -623,6 +628,11 @@ + + private IBakedModel bakeModel(ModelBlock modelBlockIn, ModelRotation modelRotationIn, boolean uvLocked) + { ++ return bakeModel(modelBlockIn, (net.minecraftforge.client.model.ITransformation)modelRotationIn, uvLocked); ++ } ++ ++ protected IBakedModel bakeModel(ModelBlock modelBlockIn, net.minecraftforge.client.model.ITransformation modelRotationIn, boolean uvLocked) ++ { + TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)this.sprites.get(new ResourceLocation(modelBlockIn.resolveTextureName("particle"))); + SimpleBakedModel.Builder simplebakedmodel$builder = (new SimpleBakedModel.Builder(modelBlockIn, modelBlockIn.func_187967_g())).setTexture(textureatlassprite); + +@@ -639,13 +649,13 @@ + BlockPartFace blockpartface = (BlockPartFace)blockpart.mapFaces.get(enumfacing); + TextureAtlasSprite textureatlassprite1 = (TextureAtlasSprite)this.sprites.get(new ResourceLocation(modelBlockIn.resolveTextureName(blockpartface.texture))); + +- if (blockpartface.cullFace == null) ++ if (blockpartface.cullFace == null || !net.minecraftforge.client.model.TRSRTransformation.isInteger(modelRotationIn.getMatrix())) + { + simplebakedmodel$builder.addGeneralQuad(this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, modelRotationIn, uvLocked)); + } + else + { +- simplebakedmodel$builder.addFaceQuad(modelRotationIn.rotateFace(blockpartface.cullFace), this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, modelRotationIn, uvLocked)); ++ simplebakedmodel$builder.addFaceQuad(modelRotationIn.rotate(blockpartface.cullFace), this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, modelRotationIn, uvLocked)); + } + } + } +@@ -656,6 +666,11 @@ + + private BakedQuad makeBakedQuad(BlockPart p_177589_1_, BlockPartFace p_177589_2_, TextureAtlasSprite p_177589_3_, EnumFacing p_177589_4_, ModelRotation p_177589_5_, boolean p_177589_6_) + { ++ return makeBakedQuad(p_177589_1_, p_177589_2_, p_177589_3_, p_177589_4_, (net.minecraftforge.client.model.ITransformation)p_177589_5_, p_177589_6_); ++ } ++ ++ protected BakedQuad makeBakedQuad(BlockPart p_177589_1_, BlockPartFace p_177589_2_, TextureAtlasSprite p_177589_3_, EnumFacing p_177589_4_, net.minecraftforge.client.model.ITransformation p_177589_5_, boolean p_177589_6_) ++ { + return this.faceBakery.makeBakedQuad(p_177589_1_.positionFrom, p_177589_1_.positionTo, p_177589_2_, p_177589_3_, p_177589_4_, p_177589_5_, p_177589_1_.partRotation, p_177589_6_, p_177589_1_.shade); + } + +@@ -878,4 +893,18 @@ + MODEL_GENERATED.name = "generation marker"; + MODEL_ENTITY.name = "block entity marker"; + } ++ ++ private static Map, Set> customVariantNames = Maps.newHashMap(); ++ ++ public static void registerItemVariants(Item item, ResourceLocation... names) ++ { ++ if (!customVariantNames.containsKey(item.delegate)) ++ { ++ customVariantNames.put(item.delegate, Sets.newHashSet()); ++ } ++ for(ResourceLocation name : names) ++ { ++ customVariantNames.get(item.delegate).add(name.toString()); ++ } ++ } + } diff --git a/rejects/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch.rej b/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java.patch similarity index 77% rename from rejects/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch.rej rename to patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java.patch index 734c561bd..6ce4d19a5 100644 --- a/rejects/minecraft/net/minecraft/client/resources/model/ModelManager.java.patch.rej +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java.patch @@ -1,4 +1,6 @@ -++++ REJECTED PATCH 1 +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ModelManager.java +@@ -24,9 +24,10 @@ public void onResourceManagerReload(IResourceManager resourceManager) { @@ -10,4 +12,3 @@ this.modelProvider.reloadModels(); } -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/resources/model/ModelRotation.java.patch.rej b/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java.patch similarity index 81% rename from rejects/minecraft/net/minecraft/client/resources/model/ModelRotation.java.patch.rej rename to patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java.patch index 9d9e7cc81..cef4d35bb 100644 --- a/rejects/minecraft/net/minecraft/client/resources/model/ModelRotation.java.patch.rej +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java.patch @@ -1,4 +1,6 @@ -++++ REJECTED PATCH 1 +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/ModelRotation.java +@@ -10,7 +10,7 @@ import org.lwjgl.util.vector.Vector3f; @SideOnly(Side.CLIENT) @@ -7,8 +9,7 @@ { X0_Y0(0, 0), X0_Y90(0, 90), -++++ END PATCH -++++ REJECTED PATCH 2 +@@ -116,4 +116,9 @@ mapRotations.put(Integer.valueOf(modelrotation.combinedXY), modelrotation); } } @@ -18,4 +19,3 @@ + public EnumFacing rotate(EnumFacing facing) { return rotateFace(facing); } + public int rotate(EnumFacing facing, int vertexIndex) { return rotateVertex(facing, vertexIndex); } } -++++ END PATCH diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/Variant.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/Variant.java.patch new file mode 100644 index 000000000..51f084a94 --- /dev/null +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/block/model/Variant.java.patch @@ -0,0 +1,20 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/model/Variant.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/model/Variant.java +@@ -32,11 +32,17 @@ + return this.field_188050_a; + } + ++ @Deprecated + public ModelRotation func_188048_b() + { + return this.field_188051_b; + } + ++ public net.minecraftforge.client.model.IModelState getState() ++ { ++ return this.field_188051_b; ++ } ++ + public boolean func_188049_c() + { + return this.field_188052_c; diff --git a/patches.mcp/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch b/patches.mcp/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch new file mode 100644 index 000000000..3d5288e13 --- /dev/null +++ b/patches.mcp/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch @@ -0,0 +1,11 @@ +--- ../src-base/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java ++++ ../src-work/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java +@@ -38,7 +38,7 @@ + } + else + { +- s = this.func_187490_a(this.name, map); ++ s = String.format("%s:%s", Block.blockRegistry.getNameForObject(state.getBlock()).getResourceDomain(), this.func_187490_a(this.name, map)); + } + + if (this.suffix != null) diff --git a/rejects/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch.rej deleted file mode 100644 index dcf329e61..000000000 --- a/rejects/minecraft/net/minecraft/client/renderer/block/model/FaceBakery.java.patch.rej +++ /dev/null @@ -1,70 +0,0 @@ -++++ REJECTED PATCH 1 - - public BakedQuad makeBakedQuad(Vector3f posFrom, Vector3f posTo, BlockPartFace face, TextureAtlasSprite sprite, EnumFacing facing, ModelRotation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) - { -+ return makeBakedQuad(posFrom, posTo, face, sprite, facing, (net.minecraftforge.client.model.ITransformation)modelRotationIn, partRotation, uvLocked, shade); -+ } -+ -+ public BakedQuad makeBakedQuad(Vector3f posFrom, Vector3f posTo, BlockPartFace face, TextureAtlasSprite sprite, EnumFacing facing, net.minecraftforge.client.model.ITransformation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) -+ { - int[] aint = this.makeQuadVertexData(face, sprite, facing, this.getPositionsDiv16(posFrom, posTo), modelRotationIn, partRotation, uvLocked, shade); - EnumFacing enumfacing = getFacingFromVertexData(aint); - -++++ END PATCH -++++ REJECTED PATCH 2 - this.func_178408_a(aint, enumfacing); - } - -+ net.minecraftforge.client.ForgeHooksClient.fillNormal(aint, enumfacing); - return new BakedQuad(aint, face.tintIndex, enumfacing); - } - - private int[] makeQuadVertexData(BlockPartFace partFace, TextureAtlasSprite sprite, EnumFacing facing, float[] p_178405_4_, ModelRotation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) - { -+ return makeQuadVertexData(partFace, sprite, facing, p_178405_4_, modelRotationIn, partRotation, uvLocked, shade); -+ } -+ -+ private int[] makeQuadVertexData(BlockPartFace partFace, TextureAtlasSprite sprite, EnumFacing facing, float[] p_178405_4_, net.minecraftforge.client.model.ITransformation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) -+ { - int[] aint = new int[28]; - - for (int i = 0; i < 4; ++i) -++++ END PATCH -++++ REJECTED PATCH 3 - - private void fillVertexData(int[] faceData, int vertexIndex, EnumFacing facing, BlockPartFace partFace, float[] p_178402_5_, TextureAtlasSprite sprite, ModelRotation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) - { -- EnumFacing enumfacing = modelRotationIn.rotateFace(facing); -+ fillVertexData(faceData, vertexIndex, facing, partFace, p_178402_5_, sprite, modelRotationIn, partRotation, uvLocked, shade); -+ } -+ -+ private void fillVertexData(int[] faceData, int vertexIndex, EnumFacing facing, BlockPartFace partFace, float[] p_178402_5_, TextureAtlasSprite sprite, net.minecraftforge.client.model.ITransformation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade) -+ { -+ EnumFacing enumfacing = modelRotationIn.rotate(facing); - int i = shade ? this.getFaceShadeColor(enumfacing) : -1; - EnumFaceDirection.VertexInformation enumfacedirection$vertexinformation = EnumFaceDirection.getFacing(facing).func_179025_a(vertexIndex); - Vector3f vector3f = new Vector3f(p_178402_5_[enumfacedirection$vertexinformation.field_179184_a], p_178402_5_[enumfacedirection$vertexinformation.field_179182_b], p_178402_5_[enumfacedirection$vertexinformation.field_179183_c]); -++++ END PATCH -++++ REJECTED PATCH 4 - - public int rotateVertex(Vector3f position, EnumFacing facing, int vertexIndex, ModelRotation modelRotationIn, boolean uvLocked) - { -+ return rotateVertex(position, facing, vertexIndex, modelRotationIn, uvLocked); -+ } -+ -+ public int rotateVertex(Vector3f position, EnumFacing facing, int vertexIndex, net.minecraftforge.client.model.ITransformation modelRotationIn, boolean uvLocked) -+ { - if (modelRotationIn == ModelRotation.X0_Y0) - { - return vertexIndex; - } - else - { -- this.rotateScale(position, new Vector3f(0.5F, 0.5F, 0.5F), modelRotationIn.getMatrix4d(), new Vector3f(1.0F, 1.0F, 1.0F)); -- return modelRotationIn.rotateVertex(facing, vertexIndex); -+ net.minecraftforge.client.ForgeHooksClient.transform(position, modelRotationIn.getMatrix()); -+ return modelRotationIn.rotate(facing, vertexIndex); - } - } - -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch.rej deleted file mode 100644 index 6c3d4d0ca..000000000 --- a/rejects/minecraft/net/minecraft/client/renderer/block/model/ModelBlockDefinition.java.patch.rej +++ /dev/null @@ -1,19 +0,0 @@ -++++ REJECTED PATCH 2 - return this.modelLocation; - } - -+ @Deprecated - public ModelRotation getRotation() - { - return this.modelRotation; - } - -+ public net.minecraftforge.client.model.IModelState getState() -+ { -+ return this.modelRotation; -+ } -+ - public boolean isUvLocked() - { - return this.uvLock; -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch.rej b/rejects/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch.rej deleted file mode 100644 index 5c3dd1f9c..000000000 --- a/rejects/minecraft/net/minecraft/client/renderer/block/statemap/StateMap.java.patch.rej +++ /dev/null @@ -1,10 +0,0 @@ -++++ REJECTED PATCH 1 - } - else - { -- s = ((IProperty)this.name).getName((Comparable)map.remove(this.name)); -+ s = String.format("%s:%s", ((ResourceLocation)Block.blockRegistry.getNameForObject(state.getBlock())).getResourceDomain(), ((IProperty)this.name).getName((Comparable)map.remove(this.name))); - } - - if (this.suffix != null) -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/resources/model/IBakedModel.java.patch.rej b/rejects/minecraft/net/minecraft/client/resources/model/IBakedModel.java.patch.rej deleted file mode 100644 index 8b56b35e3..000000000 --- a/rejects/minecraft/net/minecraft/client/resources/model/IBakedModel.java.patch.rej +++ /dev/null @@ -1,8 +0,0 @@ -++++ REJECTED PATCH 1 - - TextureAtlasSprite getParticleTexture(); - -+ @Deprecated - ItemCameraTransforms getItemCameraTransforms(); - } -++++ END PATCH diff --git a/rejects/minecraft/net/minecraft/client/resources/model/ModelBakery.java.patch.rej b/rejects/minecraft/net/minecraft/client/resources/model/ModelBakery.java.patch.rej deleted file mode 100644 index 31a5207b0..000000000 --- a/rejects/minecraft/net/minecraft/client/resources/model/ModelBakery.java.patch.rej +++ /dev/null @@ -1,131 +0,0 @@ -++++ REJECTED PATCH 1 - } - catch (Exception var6) - { -- LOGGER.warn("Unable to load variant: " + modelresourcelocation.getVariant() + " from " + modelresourcelocation); -+ LOGGER.warn("Unable to load variant: " + modelresourcelocation.getVariant() + " from " + modelresourcelocation, var6); - } - } - catch (Exception exception) -++++ END PATCH -++++ REJECTED PATCH 2 - - protected void registerVariantNames() - { -+ this.variantNames.clear(); //FML clear this to prevent double ups. - this.variantNames.put(Item.getItemFromBlock(Blocks.stone), Lists.newArrayList(new String[] {"stone", "granite", "granite_smooth", "diorite", "diorite_smooth", "andesite", "andesite_smooth"})); - this.variantNames.put(Item.getItemFromBlock(Blocks.dirt), Lists.newArrayList(new String[] {"dirt", "coarse_dirt", "podzol"})); - this.variantNames.put(Item.getItemFromBlock(Blocks.planks), Lists.newArrayList(new String[] {"oak_planks", "spruce_planks", "birch_planks", "jungle_planks", "acacia_planks", "dark_oak_planks"})); -++++ END PATCH -++++ REJECTED PATCH 3 - this.variantNames.put(Item.getItemFromBlock(Blocks.oak_fence_gate), Lists.newArrayList(new String[] {"oak_fence_gate"})); - this.variantNames.put(Item.getItemFromBlock(Blocks.oak_fence), Lists.newArrayList(new String[] {"oak_fence"})); - this.variantNames.put(Items.oak_door, Lists.newArrayList(new String[] {"oak_door"})); -+ for (Entry, Set> e : customVariantNames.entrySet()) -+ { -+ this.variantNames.put(e.getKey().get(), Lists.newArrayList(e.getValue().iterator())); -+ } - } - - protected List getVariantNames(Item p_177596_1_) -++++ END PATCH -++++ REJECTED PATCH 4 - - protected ResourceLocation getItemLocation(String p_177583_1_) - { -- ResourceLocation resourcelocation = new ResourceLocation(p_177583_1_); -+ ResourceLocation resourcelocation = new ResourceLocation(p_177583_1_.replaceAll("#.*", "")); - return new ResourceLocation(resourcelocation.getResourceDomain(), "item/" + resourcelocation.getResourcePath()); - } - -++++ END PATCH -++++ REJECTED PATCH 5 - for (Entry entry : this.itemLocations.entrySet()) - { - ResourceLocation resourcelocation = (ResourceLocation)entry.getValue(); -- ModelResourceLocation modelresourcelocation1 = new ModelResourceLocation((String)entry.getKey(), "inventory"); -+ ModelResourceLocation modelresourcelocation1 = net.minecraftforge.client.model.ModelLoader.getInventoryVariant(entry.getKey()); - ModelBlock modelblock1 = (ModelBlock)this.models.get(resourcelocation); - - if (modelblock1 != null && modelblock1.isResolved()) -++++ END PATCH -++++ REJECTED PATCH 6 - - private IBakedModel bakeModel(ModelBlock modelBlockIn, ModelRotation modelRotationIn, boolean uvLocked) - { -+ return bakeModel(modelBlockIn, (net.minecraftforge.client.model.ITransformation)modelRotationIn, uvLocked); -+ } -+ -+ protected IBakedModel bakeModel(ModelBlock modelBlockIn, net.minecraftforge.client.model.ITransformation modelRotationIn, boolean uvLocked) -+ { - TextureAtlasSprite textureatlassprite = (TextureAtlasSprite)this.sprites.get(new ResourceLocation(modelBlockIn.resolveTextureName("particle"))); - SimpleBakedModel.Builder simplebakedmodel$builder = (new SimpleBakedModel.Builder(modelBlockIn)).setTexture(textureatlassprite); - -++++ END PATCH -++++ REJECTED PATCH 7 - BlockPartFace blockpartface = (BlockPartFace)blockpart.mapFaces.get(enumfacing); - TextureAtlasSprite textureatlassprite1 = (TextureAtlasSprite)this.sprites.get(new ResourceLocation(modelBlockIn.resolveTextureName(blockpartface.texture))); - -- if (blockpartface.cullFace == null) -+ if (blockpartface.cullFace == null || !net.minecraftforge.client.model.TRSRTransformation.isInteger(modelRotationIn.getMatrix())) - { - simplebakedmodel$builder.addGeneralQuad(this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, modelRotationIn, uvLocked)); - } - else - { -- simplebakedmodel$builder.addFaceQuad(modelRotationIn.rotateFace(blockpartface.cullFace), this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, modelRotationIn, uvLocked)); -+ simplebakedmodel$builder.addFaceQuad(modelRotationIn.rotate(blockpartface.cullFace), this.makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, modelRotationIn, uvLocked)); - } - } - } -++++ END PATCH -++++ REJECTED PATCH 8 - - private BakedQuad makeBakedQuad(BlockPart p_177589_1_, BlockPartFace p_177589_2_, TextureAtlasSprite p_177589_3_, EnumFacing p_177589_4_, ModelRotation p_177589_5_, boolean p_177589_6_) - { -+ return makeBakedQuad(p_177589_1_, p_177589_2_, p_177589_3_, p_177589_4_, (net.minecraftforge.client.model.ITransformation)p_177589_5_, p_177589_6_); -+ } -+ -+ protected BakedQuad makeBakedQuad(BlockPart p_177589_1_, BlockPartFace p_177589_2_, TextureAtlasSprite p_177589_3_, EnumFacing p_177589_4_, net.minecraftforge.client.model.ITransformation p_177589_5_, boolean p_177589_6_) -+ { - return this.faceBakery.makeBakedQuad(p_177589_1_.positionFrom, p_177589_1_.positionTo, p_177589_2_, p_177589_3_, p_177589_4_, p_177589_5_, p_177589_1_.partRotation, p_177589_6_, p_177589_1_.shade); - } - -++++ END PATCH -++++ REJECTED PATCH 9 - MODEL_CLOCK.name = "class generation marker"; - MODEL_ENTITY.name = "block entity marker"; - } -+ -+ /*********************************************************** -+ * FML Start -+ ***********************************************************/ -+ private static Map, Set> customVariantNames = Maps.newHashMap(); -+ /** -+ * @deprecated use registerItemVariants -+ */ -+ @Deprecated -+ public static void addVariantName(Item item, String... names) -+ { -+ if (customVariantNames.containsKey(item.delegate)) -+ customVariantNames.get(item.delegate).addAll(Lists.newArrayList(names)); -+ else -+ customVariantNames.put(item.delegate, Sets.newHashSet(names)); -+ } -+ -+ public static void registerItemVariants(Item item, T... names) -+ { -+ if (!customVariantNames.containsKey(item.delegate)) -+ { -+ customVariantNames.put(item.delegate, Sets.newHashSet()); -+ } -+ for(ResourceLocation name : names) -+ { -+ customVariantNames.get(item.delegate).add(name.toString()); -+ } -+ } -+ /*********************************************************** -+ * FML End -+ ***********************************************************/ - } -++++ END PATCH diff --git a/src/main/resources/forge.exc b/src/main/resources/forge.exc index f1a87873a..3a3c51171 100644 --- a/src/main/resources/forge.exc +++ b/src/main/resources/forge.exc @@ -29,12 +29,12 @@ net/minecraft/server/management/ItemInWorldManager.removeBlock(Lnet/minecraft/ut net/minecraft/client/gui/GuiScreen.drawHoveringText(Ljava/util/List;IILnet/minecraft/client/gui/FontRenderer;)V=|p_146283_1_,p_146283_2_,p_146283_3_,font net/minecraft/block/state/BlockState.(Lnet/minecraft/block/Block;[Lnet/minecraft/block/properties/IProperty;Lcom/google/common/collect/ImmutableMap;)V=|p_i45663_1_,p_i45663_2_,unlistedProperties net/minecraft/client/renderer/entity/RenderItem.applyVanillaTransform(Lnet/minecraft/client/renderer/block/model/ItemTransformVec3f;)V=|p_175034_1_ -net/minecraft/client/resources/model/ModelBakery.bakeModel(Lnet/minecraft/client/renderer/block/model/ModelBlock;Lnet/minecraftforge/client/model/ITransformation;Z)Lnet/minecraft/client/resources/model/IBakedModel;=|p_177578_1_,p_177578_2_,p_177578_3_ -net/minecraft/client/resources/model/ModelBakery.makeBakedQuad(Lnet/minecraft/client/renderer/block/model/BlockPart;Lnet/minecraft/client/renderer/block/model/BlockPartFace;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraft/util/EnumFacing;Lnet/minecraftforge/client/model/ITransformation;Z)Lnet/minecraft/client/renderer/block/model/BakedQuad;=|p_177589_1_,p_177589_2_,p_177589_3_,p_177589_4_,p_177589_5_,p_177589_6_ +net/minecraft/client/renderer/block/model/ModelBakery.bakeModel(Lnet/minecraft/client/renderer/block/model/ModelBlock;Lnet/minecraftforge/client/model/ITransformation;Z)Lnet/minecraft/client/renderer/block/model/IBakedModel;=|p_177578_1_,p_177578_2_,p_177578_3_ +net/minecraft/client/renderer/block/model/ModelBakery.makeBakedQuad(Lnet/minecraft/client/renderer/block/model/BlockPart;Lnet/minecraft/client/renderer/block/model/BlockPartFace;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraft/util/EnumFacing;Lnet/minecraftforge/client/model/ITransformation;Z)Lnet/minecraft/client/renderer/block/model/BakedQuad;=|p_177589_1_,p_177589_2_,p_177589_3_,p_177589_4_,p_177589_5_,p_177589_6_ net/minecraft/client/renderer/block/model/FaceBakery.makeBakedQuad(Lorg/lwjgl/util/vector/Vector3f;Lorg/lwjgl/util/vector/Vector3f;Lnet/minecraft/client/renderer/block/model/BlockPartFace;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraft/util/EnumFacing;Lnet/minecraftforge/client/model/ITransformation;Lnet/minecraft/client/renderer/block/model/BlockPartRotation;ZZ)Lnet/minecraft/client/renderer/block/model/BakedQuad;=|p_178414_1_,p_178414_2_,p_178414_3_,p_178414_4_,p_178414_5_,p_178414_6_,p_178414_7_,p_178414_8_,p_178414_9_ -net/minecraft/client/renderer/block/model/FaceBakery.makeQuadVertexData(Lnet/minecraft/client/renderer/block/model/BlockPartFace;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraft/util/EnumFacing;[FLnet/minecraftforge/client/model/ITransformation;Lnet/minecraft/client/renderer/block/model/BlockPartRotation;ZZ)[I=|p_178405_1_,p_178405_2_,p_178405_3_,p_178405_4_,p_178405_5_,p_178405_6_,p_178405_7_,p_178405_8_ -net/minecraft/client/renderer/block/model/FaceBakery.fillVertexData([IILnet/minecraft/util/EnumFacing;Lnet/minecraft/client/renderer/block/model/BlockPartFace;[FLnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraftforge/client/model/ITransformation;Lnet/minecraft/client/renderer/block/model/BlockPartRotation;ZZ)V=|p_178402_1_,p_178402_2_,p_178402_3_,p_178402_4_,p_178402_5_,p_178402_6_,p_178402_7_,p_178402_8_,p_178402_9_,p_178402_10_ -net/minecraft/client/renderer/block/model/FaceBakery.rotateVertex(Lorg/lwjgl/util/vector/Vector3f;Lnet/minecraft/util/EnumFacing;ILnet/minecraftforge/client/model/ITransformation;Z)I=|p_178415_1_,p_178415_2_,p_178415_3_,p_178415_4_,p_178415_5_ +net/minecraft/client/renderer/block/model/FaceBakery.makeQuadVertexData(Lnet/minecraft/client/renderer/block/model/BlockPartFace;Lnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraft/util/EnumFacing;[FLnet/minecraftforge/client/model/ITransformation;Lnet/minecraft/client/renderer/block/model/BlockPartRotation;Z)[I=|p_188012_1_,p_188012_2_,p_188012_3_,p_188012_4_,p_188012_5_,p_188012_6_,p_188012_7_ +net/minecraft/client/renderer/block/model/FaceBakery.fillVertexData([IILnet/minecraft/util/EnumFacing;Lnet/minecraft/client/renderer/block/model/BlockFaceUV;[FLnet/minecraft/client/renderer/texture/TextureAtlasSprite;Lnet/minecraftforge/client/model/ITransformation;Lnet/minecraft/client/renderer/block/model/BlockPartRotation;Z)V=|p_188015_1_,p_188015_2_,p_188015_3_,p_188015_4_,p_188015_5_,p_188015_6_,p_188015_7_,p_188015_8_,p_188015_9_ +net/minecraft/client/renderer/block/model/FaceBakery.rotateVertex(Lorg/lwjgl/util/vector/Vector3f;Lnet/minecraft/util/EnumFacing;ILnet/minecraftforge/client/model/ITransformation)I=|p_188011_1_,p_188011_2_,p_188011_3_,p_188011_4_ net/minecraft/item/ItemBlock.setTileEntityNBT(Lnet/minecraft/world/World;Lnet/minecraft/util/BlockPos;Lnet/minecraft/item/ItemStack;Lnet/minecraft/entity/player/EntityPlayer;)Z=|p_179224_0_,p_179224_1_,p_179224_2_,player