Update mappings to 09/21 snapshots.
Conflict with getMatrix in ITransformation, so renamed to getMatrixVec.
This commit is contained in:
parent
5ed03945a0
commit
94e1a8e0a4
|
@ -36,7 +36,7 @@ project(':clean') {
|
||||||
patcher {
|
patcher {
|
||||||
parent = project(':mcp')
|
parent = project(':mcp')
|
||||||
patchedSrc = file('src/main/java')
|
patchedSrc = file('src/main/java')
|
||||||
mappings channel: 'snapshot', version: '20180813-1.12'
|
mappings channel: 'snapshot', version: '20180921-1.13'
|
||||||
mcVersion = '1.13'
|
mcVersion = '1.13'
|
||||||
}
|
}
|
||||||
task runclient(type: JavaExec) {
|
task runclient(type: JavaExec) {
|
||||||
|
|
|
@ -20,6 +20,15 @@
|
||||||
|
|
||||||
private void func_73972_b(int p_73972_1_, int p_73972_2_) {
|
private void func_73972_b(int p_73972_1_, int p_73972_2_) {
|
||||||
this.func_189646_b(new GuiButton(11, this.field_146294_l / 2 - 100, p_73972_1_, I18n.func_135052_a("menu.playdemo")) {
|
this.func_189646_b(new GuiButton(11, this.field_146294_l / 2 - 100, p_73972_1_, I18n.func_135052_a("menu.playdemo")) {
|
||||||
|
@@ -206,7 +212,7 @@
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.field_73973_d = this.func_189646_b(new GuiButton(12, this.field_146294_l / 2 - 100, p_73972_1_ + p_73972_2_ * 1, I18n.func_135052_a("menu.resetdemo")) {
|
||||||
|
- public void func_194829_a(double p_194829_1_, double p_194829_3_) {
|
||||||
|
+ public void func_194829_a(double mouseX, double mouseY) {
|
||||||
|
ISaveFormat isaveformat1 = GuiMainMenu.this.field_146297_k.func_71359_d();
|
||||||
|
WorldInfo worldinfo1 = isaveformat1.func_75803_c("Demo_World");
|
||||||
|
if (worldinfo1 != null) {
|
||||||
@@ -283,7 +289,10 @@
|
@@ -283,7 +289,10 @@
|
||||||
s = s + ("release".equalsIgnoreCase(this.field_146297_k.func_184123_d()) ? "" : "/" + this.field_146297_k.func_184123_d());
|
s = s + ("release".equalsIgnoreCase(this.field_146297_k.func_184123_d()) ? "" : "/" + this.field_146297_k.func_184123_d());
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
public BakedQuad func_199332_a(Vector3f p_199332_1_, Vector3f p_199332_2_, BlockPartFace p_199332_3_, TextureAtlasSprite p_199332_4_, EnumFacing p_199332_5_, ModelRotation p_199332_6_, @Nullable BlockPartRotation p_199332_7_, boolean p_199332_8_, boolean p_199332_9_) {
|
public BakedQuad func_199332_a(Vector3f p_199332_1_, Vector3f p_199332_2_, BlockPartFace p_199332_3_, TextureAtlasSprite p_199332_4_, EnumFacing p_199332_5_, ModelRotation p_199332_6_, @Nullable BlockPartRotation p_199332_7_, boolean p_199332_8_, boolean p_199332_9_) {
|
||||||
+ return makeBakedQuad(p_199332_1_, p_199332_2_, p_199332_3_, p_199332_4_, p_199332_5_, (net.minecraftforge.common.model.ITransformation)p_199332_6_, p_199332_7_, p_199332_8_, p_199332_9_);
|
+ return makeBakedQuad(p_199332_1_, p_199332_2_, p_199332_3_, p_199332_4_, p_199332_5_, (net.minecraftforge.common.model.ITransformation)p_199332_6_, p_199332_7_, p_199332_8_, p_199332_9_);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public BakedQuad makeBakedQuad(Vector3f p_199332_1_, Vector3f p_199332_2_, BlockPartFace p_199332_3_, TextureAtlasSprite p_199332_4_, EnumFacing p_199332_5_, net.minecraftforge.common.model.ITransformation p_199332_6_, BlockPartRotation p_199332_7_, boolean p_199332_8_, boolean p_199332_9_) {
|
+ public BakedQuad makeBakedQuad(Vector3f p_199332_1_, Vector3f p_199332_2_, BlockPartFace p_199332_3_, TextureAtlasSprite p_199332_4_, EnumFacing p_199332_5_, net.minecraftforge.common.model.ITransformation p_199332_6_, BlockPartRotation p_199332_7_, boolean p_199332_8_, boolean p_199332_9_) {
|
||||||
BlockFaceUV blockfaceuv = p_199332_3_.field_178243_e;
|
BlockFaceUV blockfaceuv = p_199332_3_.field_178243_e;
|
||||||
if (p_199332_8_) {
|
if (p_199332_8_) {
|
||||||
- blockfaceuv = this.func_188010_a(p_199332_3_.field_178243_e, p_199332_5_, p_199332_6_);
|
- blockfaceuv = this.func_188010_a(p_199332_3_.field_178243_e, p_199332_5_, p_199332_6_);
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
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_, @Nullable BlockPartRotation p_188012_6_, boolean p_188012_7_) {
|
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_, @Nullable BlockPartRotation p_188012_6_, boolean p_188012_7_) {
|
||||||
+ return makeQuadVertexData(p_188012_1_, p_188012_2_, p_188012_3_, p_188012_4_, (net.minecraftforge.common.model.ITransformation)p_188012_5_, p_188012_6_, p_188012_7_);
|
+ return makeQuadVertexData(p_188012_1_, p_188012_2_, p_188012_3_, p_188012_4_, (net.minecraftforge.common.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.common.model.ITransformation p_188012_5_, BlockPartRotation p_188012_6_, boolean p_188012_7_) {
|
+ private int[] makeQuadVertexData(BlockFaceUV p_188012_1_, TextureAtlasSprite p_188012_2_, EnumFacing p_188012_3_, float[] p_188012_4_, net.minecraftforge.common.model.ITransformation p_188012_5_, BlockPartRotation p_188012_6_, boolean p_188012_7_) {
|
||||||
int[] aint = new int[28];
|
int[] aint = new int[28];
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
- EnumFacing enumfacing = p_188015_7_.func_177523_a(p_188015_3_);
|
- EnumFacing enumfacing = p_188015_7_.func_177523_a(p_188015_3_);
|
||||||
+ fillVertexData(p_188015_1_, p_188015_2_, p_188015_3_, p_188015_4_, p_188015_5_, p_188015_6_, (net.minecraftforge.common.model.ITransformation)p_188015_7_, p_188015_8_, p_188015_9_);
|
+ fillVertexData(p_188015_1_, p_188015_2_, p_188015_3_, p_188015_4_, p_188015_5_, p_188015_6_, (net.minecraftforge.common.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.common.model.ITransformation p_188015_7_, BlockPartRotation p_188015_8_, boolean 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.common.model.ITransformation p_188015_7_, BlockPartRotation p_188015_8_, boolean p_188015_9_) {
|
||||||
+ EnumFacing enumfacing = p_188015_7_.rotate(p_188015_3_);
|
+ EnumFacing enumfacing = p_188015_7_.rotate(p_188015_3_);
|
||||||
int i = p_188015_9_ ? this.func_178413_a(enumfacing) : -1;
|
int i = p_188015_9_ ? this.func_178413_a(enumfacing) : -1;
|
||||||
|
@ -79,14 +79,14 @@
|
||||||
public int func_199335_a(Vector3f p_199335_1_, EnumFacing p_199335_2_, int p_199335_3_, ModelRotation p_199335_4_) {
|
public int func_199335_a(Vector3f p_199335_1_, EnumFacing p_199335_2_, int p_199335_3_, ModelRotation p_199335_4_) {
|
||||||
+ return rotateVertex(p_199335_1_, p_199335_2_, p_199335_3_, (net.minecraftforge.common.model.ITransformation)p_199335_4_);
|
+ return rotateVertex(p_199335_1_, p_199335_2_, p_199335_3_, (net.minecraftforge.common.model.ITransformation)p_199335_4_);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ public int rotateVertex(Vector3f p_199335_1_, EnumFacing p_199335_2_, int p_199335_3_, net.minecraftforge.common.model.ITransformation p_199335_4_) {
|
+ public int rotateVertex(Vector3f p_199335_1_, EnumFacing p_199335_2_, int p_199335_3_, net.minecraftforge.common.model.ITransformation p_199335_4_) {
|
||||||
if (p_199335_4_ == ModelRotation.X0_Y0) {
|
if (p_199335_4_ == ModelRotation.X0_Y0) {
|
||||||
return p_199335_3_;
|
return p_199335_3_;
|
||||||
} else {
|
} else {
|
||||||
- this.func_199334_a(p_199335_1_, new Vector3f(0.5F, 0.5F, 0.5F), p_199335_4_.func_195820_a(), new Vector3f(1.0F, 1.0F, 1.0F));
|
- this.func_199334_a(p_199335_1_, new Vector3f(0.5F, 0.5F, 0.5F), p_199335_4_.func_195820_a(), new Vector3f(1.0F, 1.0F, 1.0F));
|
||||||
- return p_199335_4_.func_177520_a(p_199335_2_, p_199335_3_);
|
- return p_199335_4_.func_177520_a(p_199335_2_, p_199335_3_);
|
||||||
+ net.minecraftforge.client.ForgeHooksClient.transform(p_199335_1_, p_199335_4_.getMatrix());
|
+ net.minecraftforge.client.ForgeHooksClient.transform(p_199335_1_, p_199335_4_.getMatrixVec());
|
||||||
+ return p_199335_4_.rotate(p_199335_2_, p_199335_3_);
|
+ return p_199335_4_.rotate(p_199335_2_, p_199335_3_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,19 +39,19 @@
|
||||||
- public IBakedModel func_209558_a(Function<ResourceLocation, IUnbakedModel> p_209558_1_, Function<ResourceLocation, TextureAtlasSprite> p_209558_2_, ModelRotation p_209558_3_, boolean p_209558_4_) {
|
- public IBakedModel func_209558_a(Function<ResourceLocation, IUnbakedModel> p_209558_1_, Function<ResourceLocation, TextureAtlasSprite> p_209558_2_, ModelRotation p_209558_3_, boolean p_209558_4_) {
|
||||||
- return this.func_209565_a(this, p_209558_1_, p_209558_2_, p_209558_3_, p_209558_4_);
|
- return this.func_209565_a(this, p_209558_1_, p_209558_2_, p_209558_3_, p_209558_4_);
|
||||||
+ @Override
|
+ @Override
|
||||||
+ public IBakedModel bake(Function<ResourceLocation, IUnbakedModel> p_209558_1_, Function<ResourceLocation, TextureAtlasSprite> p_209558_2_, net.minecraftforge.common.model.IModelState state, boolean uvlock, VertexFormat format) {
|
+ public IBakedModel bake(Function<ResourceLocation, IUnbakedModel> p_209558_1_, Function<ResourceLocation, TextureAtlasSprite> p_209558_2_, net.minecraftforge.common.model.IModelState p_209558_3_, boolean p_209558_4_, VertexFormat format) {
|
||||||
+ if (!net.minecraftforge.client.model.Attributes.moreSpecific(format, net.minecraftforge.client.model.Attributes.DEFAULT_BAKED_FORMAT)) {
|
+ if (!net.minecraftforge.client.model.Attributes.moreSpecific(format, net.minecraftforge.client.model.Attributes.DEFAULT_BAKED_FORMAT)) {
|
||||||
+ throw new IllegalArgumentException("Cannot bake vanilla model to format other than BLOCK");
|
+ throw new IllegalArgumentException("Cannot bake vanilla model to format other than BLOCK");
|
||||||
}
|
}
|
||||||
+ return func_209565_a(this, p_209558_1_, p_209558_2_, state, uvlock);
|
+ return bake(this, p_209558_1_, p_209558_2_, p_209558_3_, p_209558_4_);
|
||||||
+ }
|
+ }
|
||||||
|
|
||||||
- private IBakedModel func_209565_a(ModelBlock p_209565_1_, Function<ResourceLocation, IUnbakedModel> p_209565_2_, Function<ResourceLocation, TextureAtlasSprite> p_209565_3_, ModelRotation p_209565_4_, boolean p_209565_5_) {
|
- private IBakedModel func_209565_a(ModelBlock p_209565_1_, Function<ResourceLocation, IUnbakedModel> p_209565_2_, Function<ResourceLocation, TextureAtlasSprite> p_209565_3_, ModelRotation p_209565_4_, boolean p_209565_5_) {
|
||||||
+ private IBakedModel func_209565_a(ModelBlock p_209565_1_, Function<ResourceLocation, IUnbakedModel> p_209565_2_, Function<ResourceLocation, TextureAtlasSprite> p_209565_3_, net.minecraftforge.common.model.IModelState state, boolean uvlock) {
|
+ private IBakedModel bake(ModelBlock p_209565_1_, Function<ResourceLocation, IUnbakedModel> p_209565_2_, Function<ResourceLocation, TextureAtlasSprite> p_209565_3_, net.minecraftforge.common.model.IModelState p_209565_4_, boolean p_209565_5_) {
|
||||||
ModelBlock modelblock = this.func_178310_f();
|
ModelBlock modelblock = this.func_178310_f();
|
||||||
if (modelblock == ModelBakery.field_177606_o) {
|
if (modelblock == ModelBakery.field_177606_o) {
|
||||||
- return field_209571_g.func_209579_a(p_209565_3_, this).func_209565_a(p_209565_1_, p_209565_2_, p_209565_3_, p_209565_4_, p_209565_5_);
|
- return field_209571_g.func_209579_a(p_209565_3_, this).func_209565_a(p_209565_1_, p_209565_2_, p_209565_3_, p_209565_4_, p_209565_5_);
|
||||||
+ return field_209571_g.func_209579_a(p_209565_3_, this).func_209565_a(p_209565_1_, p_209565_2_, p_209565_3_, state, uvlock);
|
+ return field_209571_g.func_209579_a(p_209565_3_, this).bake(p_209565_1_, p_209565_2_, p_209565_3_, p_209565_4_, p_209565_5_);
|
||||||
} else if (modelblock == ModelBakery.field_177616_r) {
|
} else if (modelblock == ModelBakery.field_177616_r) {
|
||||||
return new BuiltInModel(this.func_181682_g(), this.func_209568_a(p_209565_1_, p_209565_2_, p_209565_3_));
|
return new BuiltInModel(this.func_181682_g(), this.func_209568_a(p_209565_1_, p_209565_2_, p_209565_3_));
|
||||||
} else {
|
} else {
|
||||||
|
@ -60,11 +60,11 @@
|
||||||
TextureAtlasSprite textureatlassprite1 = p_209565_3_.apply(new ResourceLocation(this.func_178308_c(blockpartface.field_178242_d)));
|
TextureAtlasSprite textureatlassprite1 = p_209565_3_.apply(new ResourceLocation(this.func_178308_c(blockpartface.field_178242_d)));
|
||||||
if (blockpartface.field_178244_b == null) {
|
if (blockpartface.field_178244_b == null) {
|
||||||
- simplebakedmodel$builder.func_177648_a(func_209567_a(blockpart, blockpartface, textureatlassprite1, enumfacing, p_209565_4_, p_209565_5_));
|
- simplebakedmodel$builder.func_177648_a(func_209567_a(blockpart, blockpartface, textureatlassprite1, enumfacing, p_209565_4_, p_209565_5_));
|
||||||
+ simplebakedmodel$builder.func_177648_a(makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, state, uvlock));
|
+ simplebakedmodel$builder.func_177648_a(makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, p_209565_4_, p_209565_5_));
|
||||||
} else {
|
} else {
|
||||||
- simplebakedmodel$builder.func_177650_a(p_209565_4_.func_177523_a(blockpartface.field_178244_b), func_209567_a(blockpart, blockpartface, textureatlassprite1, enumfacing, p_209565_4_, p_209565_5_));
|
- simplebakedmodel$builder.func_177650_a(p_209565_4_.func_177523_a(blockpartface.field_178244_b), func_209567_a(blockpart, blockpartface, textureatlassprite1, enumfacing, p_209565_4_, p_209565_5_));
|
||||||
+
|
+
|
||||||
+ simplebakedmodel$builder.func_177650_a(state.apply(Optional.empty()).map(trsr -> trsr.rotate(enumfacing)).orElse(enumfacing), makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, state, uvlock));
|
+ simplebakedmodel$builder.func_177650_a(p_209565_4_.apply(Optional.empty()).map(trsr -> trsr.rotate(enumfacing)).orElse(enumfacing), makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, p_209565_4_, p_209565_5_));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,8 +76,8 @@
|
||||||
+ return makeBakedQuad(p_209567_0_, p_209567_1_, p_209567_2_, p_209567_3_, (net.minecraftforge.common.model.IModelState) p_209567_4_, p_209567_5_);
|
+ return makeBakedQuad(p_209567_0_, p_209567_1_, p_209567_2_, p_209567_3_, (net.minecraftforge.common.model.IModelState) p_209567_4_, p_209567_5_);
|
||||||
}
|
}
|
||||||
|
|
||||||
+ public static BakedQuad makeBakedQuad(BlockPart p_209567_0_, BlockPartFace p_209567_1_, TextureAtlasSprite p_209567_2_, EnumFacing p_209567_3_, net.minecraftforge.common.model.IModelState p_209567_4_, boolean p_209567_5_) {
|
+ public static BakedQuad makeBakedQuad(BlockPart p_209567_0, BlockPartFace p_209567_1_, TextureAtlasSprite p_209567_2_, EnumFacing p_209567_3_, net.minecraftforge.common.model.IModelState p_209567_4_, boolean p_209567_5_) {
|
||||||
+ return field_209572_h.makeBakedQuad(p_209567_0_.field_178241_a, p_209567_0_.field_178239_b, p_209567_1_, p_209567_2_, p_209567_3_, p_209567_4_.apply(Optional.empty()).orElse(net.minecraftforge.common.model.TRSRTransformation.identity()), p_209567_0_.field_178237_d, p_209567_5_, p_209567_0_.field_178238_e);
|
+ return field_209572_h.makeBakedQuad(p_209567_0.field_178241_a, p_209567_0.field_178239_b, p_209567_1_, p_209567_2_, p_209567_3_, p_209567_4_.apply(Optional.empty()).orElse(net.minecraftforge.common.model.TRSRTransformation.identity()), p_209567_0.field_178237_d, p_209567_5_, p_209567_0.field_178238_e);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
public boolean func_178300_b(String p_178300_1_) {
|
public boolean func_178300_b(String p_178300_1_) {
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
public static ModelRotation func_177524_a(int p_177524_0_, int p_177524_1_) {
|
public static ModelRotation func_177524_a(int p_177524_0_, int p_177524_1_) {
|
||||||
return field_177546_q.get(func_177521_b(MathHelper.func_180184_b(p_177524_0_, 360), MathHelper.func_180184_b(p_177524_1_, 360)));
|
return field_177546_q.get(func_177521_b(MathHelper.func_180184_b(p_177524_0_, 360), MathHelper.func_180184_b(p_177524_1_, 360)));
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ public java.util.Optional<net.minecraftforge.common.model.TRSRTransformation> apply(java.util.Optional<? extends net.minecraftforge.common.model.IModelPart> part) { return net.minecraftforge.client.ForgeHooksClient.applyTransform(this, part); }
|
+ public java.util.Optional<net.minecraftforge.common.model.TRSRTransformation> apply(java.util.Optional<? extends net.minecraftforge.common.model.IModelPart> part) { return net.minecraftforge.client.ForgeHooksClient.applyTransform(this, part); }
|
||||||
+ public javax.vecmath.Matrix4f getMatrix() { return net.minecraftforge.common.model.TRSRTransformation.from(this).getMatrix(); }
|
+ public javax.vecmath.Matrix4f getMatrixVec() { return net.minecraftforge.common.model.TRSRTransformation.from(this).getMatrixVec(); }
|
||||||
+ public EnumFacing rotate(EnumFacing facing) { return func_177523_a(facing); }
|
+ public EnumFacing rotate(EnumFacing facing) { return func_177523_a(facing); }
|
||||||
+ public int rotate(EnumFacing facing, int vertexIndex) { return func_177520_a(facing, vertexIndex); }
|
+ public int rotate(EnumFacing facing, int vertexIndex) { return func_177520_a(facing, vertexIndex); }
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public EnumActionResult func_196084_a(ItemUseContext p_196084_1_) {
|
public EnumActionResult func_196084_a(ItemUseContext p_196084_1_) {
|
||||||
+ //if (!p_196084_1_.field_196006_g.isRemote) return net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(p_196084_1_);
|
+ //if (!context.world.isRemote) return net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(context);
|
||||||
EntityPlayer entityplayer = p_196084_1_.func_195999_j();
|
EntityPlayer entityplayer = p_196084_1_.func_195999_j();
|
||||||
BlockPos blockpos = p_196084_1_.func_195995_a();
|
BlockPos blockpos = p_196084_1_.func_195995_a();
|
||||||
BlockWorldState blockworldstate = new BlockWorldState(p_196084_1_.func_195991_k(), blockpos, false);
|
BlockWorldState blockworldstate = new BlockWorldState(p_196084_1_.func_195991_k(), blockpos, false);
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
--- a/net/minecraft/world/lighting/BlockLightEngine.java
|
||||||
|
+++ b/net/minecraft/world/lighting/BlockLightEngine.java
|
||||||
|
@@ -12,7 +12,7 @@
|
||||||
|
|
||||||
|
public void func_202677_a(WorldGenRegion p_202677_1_, IChunk p_202677_2_) {
|
||||||
|
for(BlockPos blockpos : p_202677_2_.func_201582_h()) {
|
||||||
|
- this.func_202667_a(p_202677_1_, blockpos, this.func_202670_c(p_202677_1_, blockpos));
|
||||||
|
+ this.func_202667_a(p_202677_1_, blockpos, this.func_202670_c((net.minecraft.world.IBlockReader)p_202677_1_, blockpos)); //Forge add typecast to fix obf issue.
|
||||||
|
this.func_202659_a(p_202677_2_.func_76632_l(), blockpos, this.func_202666_a(p_202677_1_, blockpos));
|
||||||
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||||
private static final boolean WIREFRAME = false;
|
private static final boolean WIREFRAME = false;
|
||||||
|
|
||||||
// Instance fields
|
// Instance fields
|
||||||
private final Minecraft mc = Minecraft.getMinecraft();
|
private final Minecraft mc = Minecraft.getInstance();
|
||||||
private final ResourceLocation texture = new ResourceLocation("textures/environment/clouds.png");
|
private final ResourceLocation texture = new ResourceLocation("textures/environment/clouds.png");
|
||||||
|
|
||||||
private int displayList = -1;
|
private int displayList = -1;
|
||||||
|
@ -81,7 +81,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||||
public CloudRenderer()
|
public CloudRenderer()
|
||||||
{
|
{
|
||||||
// Resource manager should always be reloadable.
|
// Resource manager should always be reloadable.
|
||||||
((IReloadableResourceManager) mc.func_195551_G()).func_199006_a(this);
|
((IReloadableResourceManager) mc.getResourceManager()).addReloadListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getScale()
|
private int getScale()
|
||||||
|
@ -243,7 +243,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||||
if (OpenGlHelper.useVbo())
|
if (OpenGlHelper.useVbo())
|
||||||
vbo = new VertexBuffer(FORMAT);
|
vbo = new VertexBuffer(FORMAT);
|
||||||
else
|
else
|
||||||
GlStateManager.glNewList(displayList = GLAllocation.generateDisplayLists(1), GL11.GL_COMPILE);
|
GlStateManager.newList(displayList = GLAllocation.generateDisplayLists(1), GL11.GL_COMPILE);
|
||||||
|
|
||||||
vertices(buffer);
|
vertices(buffer);
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tess.draw();
|
tess.draw();
|
||||||
GlStateManager.glEndList();
|
GlStateManager.endList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -275,7 +275,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||||
boolean newEnabled = ForgeMod.forgeCloudsEnabled
|
boolean newEnabled = ForgeMod.forgeCloudsEnabled
|
||||||
&& mc.gameSettings.shouldRenderClouds() != 0
|
&& mc.gameSettings.shouldRenderClouds() != 0
|
||||||
&& mc.world != null
|
&& mc.world != null
|
||||||
&& mc.world.provider.isSurfaceWorld();
|
&& mc.world.dimension.isSurfaceWorld();
|
||||||
|
|
||||||
if (isBuilt()
|
if (isBuilt()
|
||||||
&& (!newEnabled
|
&& (!newEnabled
|
||||||
|
@ -305,7 +305,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||||
|
|
||||||
double x = entity.prevPosX + (entity.posX - entity.prevPosX) * partialTicks
|
double x = entity.prevPosX + (entity.posX - entity.prevPosX) * partialTicks
|
||||||
+ totalOffset * 0.03;
|
+ totalOffset * 0.03;
|
||||||
double y = mc.world.provider.getCloudHeight()
|
double y = mc.world.dimension.getCloudHeight()
|
||||||
- (entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks)
|
- (entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks)
|
||||||
+ 0.33;
|
+ 0.33;
|
||||||
double z = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * partialTicks;
|
double z = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * partialTicks;
|
||||||
|
@ -322,7 +322,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
|
|
||||||
// Translate by the remainder after the UV offset.
|
// Translate by the remainder after the UV offset.
|
||||||
GlStateManager.translate((offU * scale) - x, y, (offV * scale) - z);
|
GlStateManager.translated((offU * scale) - x, y, (offV * scale) - z);
|
||||||
|
|
||||||
// Modulo to prevent texture samples becoming inaccurate at extreme offsets.
|
// Modulo to prevent texture samples becoming inaccurate at extreme offsets.
|
||||||
offU = offU % texW;
|
offU = offU % texW;
|
||||||
|
@ -330,13 +330,13 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||||
|
|
||||||
// Translate the texture.
|
// Translate the texture.
|
||||||
GlStateManager.matrixMode(GL11.GL_TEXTURE);
|
GlStateManager.matrixMode(GL11.GL_TEXTURE);
|
||||||
GlStateManager.translate(offU * PX_SIZE, offV * PX_SIZE, 0);
|
GlStateManager.translatef(offU * PX_SIZE, offV * PX_SIZE, 0);
|
||||||
GlStateManager.matrixMode(GL11.GL_MODELVIEW);
|
GlStateManager.matrixMode(GL11.GL_MODELVIEW);
|
||||||
|
|
||||||
GlStateManager.disableCull();
|
GlStateManager.disableCull();
|
||||||
|
|
||||||
GlStateManager.enableBlend();
|
GlStateManager.enableBlend();
|
||||||
GlStateManager.tryBlendFuncSeparate(
|
GlStateManager.blendFuncSeparate(
|
||||||
GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA,
|
GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA,
|
||||||
GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
||||||
|
|
||||||
|
@ -350,19 +350,19 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||||
COLOR_TEX = new DynamicTexture(1, 1, false);
|
COLOR_TEX = new DynamicTexture(1, 1, false);
|
||||||
|
|
||||||
// Apply a color multiplier through a texture upload if shaders aren't supported.
|
// Apply a color multiplier through a texture upload if shaders aren't supported.
|
||||||
COLOR_TEX.func_195414_e().func_195700_a(0, 0, 255 << 24
|
COLOR_TEX.getTextureData().setPixelRGBA(0, 0, 255 << 24
|
||||||
| ((int) (r * 255)) << 16
|
| ((int) (r * 255)) << 16
|
||||||
| ((int) (g * 255)) << 8
|
| ((int) (g * 255)) << 8
|
||||||
| (int) (b * 255));
|
| (int) (b * 255));
|
||||||
COLOR_TEX.updateDynamicTexture();
|
COLOR_TEX.updateDynamicTexture();
|
||||||
|
|
||||||
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
|
GlStateManager.activeTexture(OpenGlHelper.GL_TEXTURE1);
|
||||||
GlStateManager.bindTexture(COLOR_TEX.getGlTextureId());
|
GlStateManager.bindTexture(COLOR_TEX.getGlTextureId());
|
||||||
GlStateManager.enableTexture2D();
|
GlStateManager.enableTexture2D();
|
||||||
|
|
||||||
// Bind the clouds texture last so the shader's sampler2D is correct.
|
// Bind the clouds texture last so the shader's sampler2D is correct.
|
||||||
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
|
GlStateManager.activeTexture(OpenGlHelper.GL_TEXTURE0);
|
||||||
mc.renderEngine.bindTexture(texture);
|
mc.textureManager.bindTexture(texture);
|
||||||
|
|
||||||
ByteBuffer buffer = Tessellator.getInstance().getBuffer().getByteBuffer();
|
ByteBuffer buffer = Tessellator.getInstance().getBuffer().getByteBuffer();
|
||||||
|
|
||||||
|
@ -372,12 +372,12 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||||
vbo.bindBuffer();
|
vbo.bindBuffer();
|
||||||
|
|
||||||
int stride = FORMAT.getSize();
|
int stride = FORMAT.getSize();
|
||||||
GlStateManager.glVertexPointer(3, GL11.GL_FLOAT, stride, 0);
|
GlStateManager.vertexPointer(3, GL11.GL_FLOAT, stride, 0);
|
||||||
GlStateManager.glEnableClientState(GL11.GL_VERTEX_ARRAY);
|
GlStateManager.enableClientState(GL11.GL_VERTEX_ARRAY);
|
||||||
GlStateManager.glTexCoordPointer(2, GL11.GL_FLOAT, stride, 12);
|
GlStateManager.texCoordPointer(2, GL11.GL_FLOAT, stride, 12);
|
||||||
GlStateManager.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
|
GlStateManager.enableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
|
||||||
GlStateManager.glColorPointer(4, GL11.GL_UNSIGNED_BYTE, stride, 20);
|
GlStateManager.colorPointer(4, GL11.GL_UNSIGNED_BYTE, stride, 20);
|
||||||
GlStateManager.glEnableClientState(GL11.GL_COLOR_ARRAY);
|
GlStateManager.enableClientState(GL11.GL_COLOR_ARRAY);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -400,8 +400,8 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||||
// Wireframe for debug.
|
// Wireframe for debug.
|
||||||
if (WIREFRAME)
|
if (WIREFRAME)
|
||||||
{
|
{
|
||||||
GlStateManager.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE);
|
GlStateManager.polygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE);
|
||||||
GlStateManager.glLineWidth(2.0F);
|
GlStateManager.lineWidth(2.0F);
|
||||||
GlStateManager.disableTexture2D();
|
GlStateManager.disableTexture2D();
|
||||||
GlStateManager.depthMask(false);
|
GlStateManager.depthMask(false);
|
||||||
GlStateManager.disableFog();
|
GlStateManager.disableFog();
|
||||||
|
@ -409,7 +409,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||||
vbo.drawArrays(GL11.GL_QUADS);
|
vbo.drawArrays(GL11.GL_QUADS);
|
||||||
else
|
else
|
||||||
GlStateManager.callList(displayList);
|
GlStateManager.callList(displayList);
|
||||||
GlStateManager.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL);
|
GlStateManager.polygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL);
|
||||||
GlStateManager.depthMask(true);
|
GlStateManager.depthMask(true);
|
||||||
GlStateManager.enableTexture2D();
|
GlStateManager.enableTexture2D();
|
||||||
GlStateManager.enableFog();
|
GlStateManager.enableFog();
|
||||||
|
@ -431,9 +431,9 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||||
buffer.position(0);
|
buffer.position(0);
|
||||||
|
|
||||||
// Disable our coloring.
|
// Disable our coloring.
|
||||||
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
|
GlStateManager.activeTexture(OpenGlHelper.GL_TEXTURE1);
|
||||||
GlStateManager.disableTexture2D();
|
GlStateManager.disableTexture2D();
|
||||||
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
|
GlStateManager.activeTexture(OpenGlHelper.GL_TEXTURE0);
|
||||||
|
|
||||||
// Reset texture matrix.
|
// Reset texture matrix.
|
||||||
GlStateManager.matrixMode(GL11.GL_TEXTURE);
|
GlStateManager.matrixMode(GL11.GL_TEXTURE);
|
||||||
|
@ -450,9 +450,9 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||||
|
|
||||||
private void reloadTextures()
|
private void reloadTextures()
|
||||||
{
|
{
|
||||||
if (mc.renderEngine != null)
|
if (mc.textureManager != null)
|
||||||
{
|
{
|
||||||
mc.renderEngine.bindTexture(texture);
|
mc.textureManager.bindTexture(texture);
|
||||||
texW = GlStateManager.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH);
|
texW = GlStateManager.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH);
|
||||||
texH = GlStateManager.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_HEIGHT);
|
texH = GlStateManager.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_HEIGHT);
|
||||||
}
|
}
|
||||||
|
@ -482,7 +482,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
|
||||||
|
|
||||||
public static boolean renderClouds(int cloudTicks, float partialTicks, WorldClient world, Minecraft client)
|
public static boolean renderClouds(int cloudTicks, float partialTicks, WorldClient world, Minecraft client)
|
||||||
{
|
{
|
||||||
IRenderHandler renderer = world.provider.getCloudRenderer();
|
IRenderHandler renderer = world.dimension.getCloudRenderer();
|
||||||
if (renderer != null)
|
if (renderer != null)
|
||||||
{
|
{
|
||||||
renderer.render(partialTicks, world, client);
|
renderer.render(partialTicks, world, client);
|
||||||
|
|
|
@ -45,7 +45,7 @@ public class ForgeClientHandler
|
||||||
{
|
{
|
||||||
if (FluidRegistry.isUniversalBucketEnabled())
|
if (FluidRegistry.isUniversalBucketEnabled())
|
||||||
{
|
{
|
||||||
event.getItemColors().func_199877_a(new FluidContainerColorer(), ForgeMod.getInstance().universalBucket);
|
event.getItemColors().register(new FluidContainerColorer(), ForgeMod.getInstance().universalBucket);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -266,7 +266,7 @@ public class ForgeHooksClient
|
||||||
}
|
}
|
||||||
skyInit = true;
|
skyInit = true;
|
||||||
|
|
||||||
GameSettings settings = Minecraft.getMinecraft().gameSettings;
|
GameSettings settings = Minecraft.getInstance().gameSettings;
|
||||||
int[] ranges = ForgeMod.blendRanges;
|
int[] ranges = ForgeMod.blendRanges;
|
||||||
int distance = 0;
|
int distance = 0;
|
||||||
if (settings.fancyGraphics && ranges.length > 0)
|
if (settings.fancyGraphics && ranges.length > 0)
|
||||||
|
@ -360,7 +360,7 @@ public class ForgeHooksClient
|
||||||
public static void drawScreen(GuiScreen screen, int mouseX, int mouseY, float partialTicks)
|
public static void drawScreen(GuiScreen screen, int mouseX, int mouseY, float partialTicks)
|
||||||
{
|
{
|
||||||
if (!MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.DrawScreenEvent.Pre(screen, mouseX, mouseY, partialTicks)))
|
if (!MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.DrawScreenEvent.Pre(screen, mouseX, mouseY, partialTicks)))
|
||||||
screen.drawScreen(mouseX, mouseY, partialTicks);
|
screen.render(mouseX, mouseY, partialTicks);
|
||||||
MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.DrawScreenEvent.Post(screen, mouseX, mouseY, partialTicks));
|
MinecraftForge.EVENT_BUS.post(new GuiScreenEvent.DrawScreenEvent.Post(screen, mouseX, mouseY, partialTicks));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -389,18 +389,18 @@ public class ForgeHooksClient
|
||||||
m.setIdentity();
|
m.setIdentity();
|
||||||
m.setTranslation(TRSRTransformation.toVecmath(transform.translation));
|
m.setTranslation(TRSRTransformation.toVecmath(transform.translation));
|
||||||
t.setIdentity();
|
t.setIdentity();
|
||||||
t.rotY(transform.rotation.func_195900_b());
|
t.rotY(transform.rotation.getY());
|
||||||
m.mul(t);
|
m.mul(t);
|
||||||
t.setIdentity();
|
t.setIdentity();
|
||||||
t.rotX(transform.rotation.func_195899_a());
|
t.rotX(transform.rotation.getX());
|
||||||
m.mul(t);
|
m.mul(t);
|
||||||
t.setIdentity();
|
t.setIdentity();
|
||||||
t.rotZ(transform.rotation.func_195902_c());
|
t.rotZ(transform.rotation.getZ());
|
||||||
m.mul(t);
|
m.mul(t);
|
||||||
t.setIdentity();
|
t.setIdentity();
|
||||||
t.m00 = transform.scale.func_195899_a();
|
t.m00 = transform.scale.getX();
|
||||||
t.m11 = transform.scale.func_195900_b();
|
t.m11 = transform.scale.getY();
|
||||||
t.m22 = transform.scale.func_195902_c();
|
t.m22 = transform.scale.getZ();
|
||||||
m.mul(t);
|
m.mul(t);
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
@ -471,10 +471,10 @@ public class ForgeHooksClient
|
||||||
glEnableClientState(GL_COLOR_ARRAY);
|
glEnableClientState(GL_COLOR_ARRAY);
|
||||||
break;
|
break;
|
||||||
case UV:
|
case UV:
|
||||||
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + attr.getIndex());
|
OpenGlHelper.glClientActiveTexture(OpenGlHelper.GL_TEXTURE0 + attr.getIndex());
|
||||||
glTexCoordPointer(count, constant, stride, buffer);
|
glTexCoordPointer(count, constant, stride, buffer);
|
||||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||||
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
|
OpenGlHelper.glClientActiveTexture(OpenGlHelper.GL_TEXTURE0);
|
||||||
break;
|
break;
|
||||||
case PADDING:
|
case PADDING:
|
||||||
break;
|
break;
|
||||||
|
@ -503,9 +503,9 @@ public class ForgeHooksClient
|
||||||
GlStateManager.resetColor();
|
GlStateManager.resetColor();
|
||||||
break;
|
break;
|
||||||
case UV:
|
case UV:
|
||||||
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + attr.getIndex());
|
OpenGlHelper.glClientActiveTexture(OpenGlHelper.GL_TEXTURE0 + attr.getIndex());
|
||||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||||
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
|
OpenGlHelper.glClientActiveTexture(OpenGlHelper.GL_TEXTURE0);
|
||||||
break;
|
break;
|
||||||
case PADDING:
|
case PADDING:
|
||||||
break;
|
break;
|
||||||
|
@ -518,15 +518,15 @@ public class ForgeHooksClient
|
||||||
|
|
||||||
public static void transform(net.minecraft.client.renderer.Vector3f vec, Matrix4f m)
|
public static void transform(net.minecraft.client.renderer.Vector3f vec, Matrix4f m)
|
||||||
{
|
{
|
||||||
Vector4f tmp = new Vector4f(vec.func_195899_a(), vec.func_195900_b(), vec.func_195902_c(), 1f);
|
Vector4f tmp = new Vector4f(vec.getX(), vec.getY(), vec.getZ(), 1f);
|
||||||
m.transform(tmp);
|
m.transform(tmp);
|
||||||
if(Math.abs(tmp.w - 1f) > 1e-5) tmp.scale(1f / tmp.w);
|
if(Math.abs(tmp.w - 1f) > 1e-5) tmp.scale(1f / tmp.w);
|
||||||
vec.func_195905_a(tmp.x, tmp.y, tmp.z);
|
vec.set(tmp.x, tmp.y, tmp.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Matrix4f getMatrix(ModelRotation modelRotation)
|
public static Matrix4f getMatrix(ModelRotation modelRotation)
|
||||||
{
|
{
|
||||||
Matrix4f ret = new Matrix4f(TRSRTransformation.toVecmath(modelRotation.func_195820_a()), new Vector3f(), 1), tmp = new Matrix4f();
|
Matrix4f ret = new Matrix4f(TRSRTransformation.toVecmath(modelRotation.getMatrix()), new Vector3f(), 1), tmp = new Matrix4f();
|
||||||
tmp.setIdentity();
|
tmp.setIdentity();
|
||||||
tmp.m03 = tmp.m13 = tmp.m23 = .5f;
|
tmp.m03 = tmp.m13 = tmp.m23 = .5f;
|
||||||
ret.mul(tmp, ret);
|
ret.mul(tmp, ret);
|
||||||
|
@ -570,7 +570,7 @@ public class ForgeHooksClient
|
||||||
TileEntityRenderer<?> r = TileEntityRendererDispatcher.instance.getRenderer(tileClass);
|
TileEntityRenderer<?> r = TileEntityRendererDispatcher.instance.getRenderer(tileClass);
|
||||||
if (r != null)
|
if (r != null)
|
||||||
{
|
{
|
||||||
r.func_199341_a(null, 0, 0, 0, 0, -1);
|
r.render(null, 0, 0, 0, 0, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -646,7 +646,7 @@ public class ForgeHooksClient
|
||||||
public static IBakedModel getDamageModel(IBakedModel ibakedmodel, TextureAtlasSprite texture, IBlockState state, IWorldReader world, BlockPos pos)
|
public static IBakedModel getDamageModel(IBakedModel ibakedmodel, TextureAtlasSprite texture, IBlockState state, IWorldReader world, BlockPos pos)
|
||||||
{
|
{
|
||||||
state = state.getBlock().getExtendedState(state, world, pos);
|
state = state.getBlock().getExtendedState(state, world, pos);
|
||||||
return (new SimpleBakedModel.Builder(state, ibakedmodel, texture, new Random(), 42)).makeBakedModel();
|
return (new SimpleBakedModel.Builder(state, ibakedmodel, texture, new Random(), 42)).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int slotMainHand = 0;
|
private static int slotMainHand = 0;
|
||||||
|
@ -675,8 +675,8 @@ public class ForgeHooksClient
|
||||||
|
|
||||||
public static BlockFaceUV applyUVLock(BlockFaceUV blockFaceUV, EnumFacing originalSide, ITransformation rotation)
|
public static BlockFaceUV applyUVLock(BlockFaceUV blockFaceUV, EnumFacing originalSide, ITransformation rotation)
|
||||||
{
|
{
|
||||||
TRSRTransformation global = new TRSRTransformation(rotation.getMatrix());
|
TRSRTransformation global = new TRSRTransformation(rotation.getMatrixVec());
|
||||||
Matrix4f uv = global.getUVLockTransform(originalSide).getMatrix();
|
Matrix4f uv = global.getUVLockTransform(originalSide).getMatrixVec();
|
||||||
Vector4f vec = new Vector4f(0, 0, 0, 1);
|
Vector4f vec = new Vector4f(0, 0, 0, 1);
|
||||||
float u0 = blockFaceUV.getVertexU(blockFaceUV.getVertexRotatedRev(0));
|
float u0 = blockFaceUV.getVertexU(blockFaceUV.getVertexRotatedRev(0));
|
||||||
float v0 = blockFaceUV.getVertexV(blockFaceUV.getVertexRotatedRev(0));
|
float v0 = blockFaceUV.getVertexV(blockFaceUV.getVertexRotatedRev(0));
|
||||||
|
@ -740,7 +740,7 @@ public class ForgeHooksClient
|
||||||
{
|
{
|
||||||
TRSRTransformation tr = TRSRTransformation.from(model.getItemCameraTransforms().getTransform(type));
|
TRSRTransformation tr = TRSRTransformation.from(model.getItemCameraTransforms().getTransform(type));
|
||||||
Matrix4f mat = null;
|
Matrix4f mat = null;
|
||||||
if(!tr.equals(TRSRTransformation.identity())) mat = tr.getMatrix();
|
if(!tr.equals(TRSRTransformation.identity())) mat = tr.getMatrixVec();
|
||||||
return Pair.of(model, mat);
|
return Pair.of(model, mat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,9 +106,9 @@ public class GuiIngameForge extends GuiIngame
|
||||||
@Override
|
@Override
|
||||||
public void renderGameOverlay(float partialTicks)
|
public void renderGameOverlay(float partialTicks)
|
||||||
{
|
{
|
||||||
this.field_194811_H = this.mc.field_195558_d.func_198107_o();
|
this.scaledWidth = this.mc.mainWindow.getScaledWidth();
|
||||||
this.field_194812_I = this.mc.field_195558_d.func_198087_p();
|
this.scaledHeight = this.mc.mainWindow.getScaledHeight();
|
||||||
eventParent = new RenderGameOverlayEvent(partialTicks, this.mc.field_195558_d);
|
eventParent = new RenderGameOverlayEvent(partialTicks, this.mc.mainWindow);
|
||||||
renderHealthMount = mc.player.getRidingEntity() instanceof EntityLivingBase;
|
renderHealthMount = mc.player.getRidingEntity() instanceof EntityLivingBase;
|
||||||
renderFood = mc.player.getRidingEntity() == null;
|
renderFood = mc.player.getRidingEntity() == null;
|
||||||
renderJumpBar = mc.player.isRidingHorse();
|
renderJumpBar = mc.player.isRidingHorse();
|
||||||
|
@ -124,71 +124,71 @@ public class GuiIngameForge extends GuiIngame
|
||||||
|
|
||||||
if (renderVignette && Minecraft.isFancyGraphicsEnabled())
|
if (renderVignette && Minecraft.isFancyGraphicsEnabled())
|
||||||
{
|
{
|
||||||
func_194800_d(mc.player.getBrightness());
|
renderVignette(mc.player.getBrightness());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GlStateManager.enableDepth();
|
GlStateManager.enableDepthTest();
|
||||||
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (renderHelmet) renderHelmet(partialTicks);
|
if (renderHelmet) renderHelmet(partialTicks);
|
||||||
|
|
||||||
if (renderPortal && !mc.player.isPotionActive(MobEffects.NAUSEA))
|
if (renderPortal && !mc.player.isPotionActive(MobEffects.NAUSEA))
|
||||||
{
|
{
|
||||||
func_194805_e(partialTicks);
|
renderPortal(partialTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (renderHotbar) func_194806_b(partialTicks);
|
if (renderHotbar) renderHotbar(partialTicks);
|
||||||
|
|
||||||
if (!this.mc.gameSettings.hideGUI) {
|
if (!this.mc.gameSettings.hideGUI) {
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
zLevel = -90.0F;
|
zLevel = -90.0F;
|
||||||
rand.setSeed((long)(updateCounter * 312871));
|
rand.setSeed((long)(ticks * 312871));
|
||||||
|
|
||||||
if (renderCrosshairs) func_194798_c(partialTicks);
|
if (renderCrosshairs) renderAttackIndicator(partialTicks);
|
||||||
if (renderBossHealth) renderBossHealth();
|
if (renderBossHealth) renderBossHealth();
|
||||||
|
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
if (this.mc.playerController.shouldDrawHUD() && this.mc.getRenderViewEntity() instanceof EntityPlayer)
|
if (this.mc.playerController.shouldDrawHUD() && this.mc.getRenderViewEntity() instanceof EntityPlayer)
|
||||||
{
|
{
|
||||||
if (renderHealth) renderHealth(this.field_194811_H, this.field_194812_I);
|
if (renderHealth) renderHealth(this.scaledWidth, this.scaledHeight);
|
||||||
if (renderArmor) renderArmor(this.field_194811_H, this.field_194812_I);
|
if (renderArmor) renderArmor(this.scaledWidth, this.scaledHeight);
|
||||||
if (renderFood) renderFood(this.field_194811_H, this.field_194812_I);
|
if (renderFood) renderFood(this.scaledWidth, this.scaledHeight);
|
||||||
if (renderHealthMount) renderHealthMount(this.field_194811_H, this.field_194812_I);
|
if (renderHealthMount) renderHealthMount(this.scaledWidth, this.scaledHeight);
|
||||||
if (renderAir) renderAir(this.field_194811_H, this.field_194812_I);
|
if (renderAir) renderAir(this.scaledWidth, this.scaledHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (renderJumpBar)
|
if (renderJumpBar)
|
||||||
{
|
{
|
||||||
func_194803_a(this.field_194811_H / 2 - 91);
|
renderHorseJumpBar(this.scaledWidth / 2 - 91);
|
||||||
}
|
}
|
||||||
else if (renderExperiance)
|
else if (renderExperiance)
|
||||||
{
|
{
|
||||||
renderExperience(this.field_194811_H / 2 - 91);
|
renderExperience(this.scaledWidth / 2 - 91);
|
||||||
}
|
}
|
||||||
if (this.mc.gameSettings.heldItemTooltips && this.mc.playerController.getCurrentGameType() != GameType.SPECTATOR) {
|
if (this.mc.gameSettings.heldItemTooltips && this.mc.playerController.getCurrentGameType() != GameType.SPECTATOR) {
|
||||||
this.func_194801_c();
|
this.renderSelectedItem();
|
||||||
} else if (this.mc.player.isSpectator()) {
|
} else if (this.mc.player.isSpectator()) {
|
||||||
this.spectatorGui.func_195623_a();
|
this.spectatorGui.renderSelectedItem();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
renderSleepFade(this.field_194811_H, this.field_194812_I);
|
renderSleepFade(this.scaledWidth, this.scaledHeight);
|
||||||
|
|
||||||
renderHUDText(this.field_194811_H, this.field_194812_I);
|
renderHUDText(this.scaledWidth, this.scaledHeight);
|
||||||
renderFPSGraph();
|
renderFPSGraph();
|
||||||
func_194809_b();
|
renderPotionEffects();
|
||||||
if (!mc.gameSettings.hideGUI) {
|
if (!mc.gameSettings.hideGUI) {
|
||||||
renderRecordOverlay(this.field_194811_H, this.field_194812_I, partialTicks);
|
renderRecordOverlay(this.scaledWidth, this.scaledHeight, partialTicks);
|
||||||
renderSubtitles();
|
renderSubtitles();
|
||||||
renderTitle(this.field_194811_H, this.field_194812_I, partialTicks);
|
renderTitle(this.scaledWidth, this.scaledHeight, partialTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Scoreboard scoreboard = this.mc.world.getScoreboard();
|
Scoreboard scoreboard = this.mc.world.getScoreboard();
|
||||||
ScoreObjective objective = null;
|
ScoreObjective objective = null;
|
||||||
ScorePlayerTeam scoreplayerteam = scoreboard.getPlayersTeam(mc.player.func_195047_I_());
|
ScorePlayerTeam scoreplayerteam = scoreboard.getPlayersTeam(mc.player.getScoreboardName());
|
||||||
if (scoreplayerteam != null)
|
if (scoreplayerteam != null)
|
||||||
{
|
{
|
||||||
int slot = scoreplayerteam.getColor().getColorIndex();
|
int slot = scoreplayerteam.getColor().getColorIndex();
|
||||||
|
@ -197,46 +197,46 @@ public class GuiIngameForge extends GuiIngame
|
||||||
ScoreObjective scoreobjective1 = objective != null ? objective : scoreboard.getObjectiveInDisplaySlot(1);
|
ScoreObjective scoreobjective1 = objective != null ? objective : scoreboard.getObjectiveInDisplaySlot(1);
|
||||||
if (renderObjective && scoreobjective1 != null)
|
if (renderObjective && scoreobjective1 != null)
|
||||||
{
|
{
|
||||||
this.func_194802_a(scoreobjective1);
|
this.renderScoreboard(scoreobjective1);
|
||||||
}
|
}
|
||||||
|
|
||||||
GlStateManager.enableBlend();
|
GlStateManager.enableBlend();
|
||||||
GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
GlStateManager.blendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||||
GlStateManager.disableAlpha();
|
GlStateManager.disableAlphaTest();
|
||||||
|
|
||||||
renderChat(this.field_194811_H, this.field_194812_I);
|
renderChat(this.scaledWidth, this.scaledHeight);
|
||||||
|
|
||||||
renderPlayerList(this.field_194811_H, this.field_194812_I);
|
renderPlayerList(this.scaledWidth, this.scaledHeight);
|
||||||
|
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
GlStateManager.disableLighting();
|
GlStateManager.disableLighting();
|
||||||
GlStateManager.enableAlpha();
|
GlStateManager.enableAlphaTest();
|
||||||
|
|
||||||
post(ALL);
|
post(ALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void func_194798_c(float partialTicks)
|
protected void renderAttackIndicator(float partialTicks)
|
||||||
{
|
{
|
||||||
if (pre(CROSSHAIRS)) return;
|
if (pre(CROSSHAIRS)) return;
|
||||||
bind(Gui.ICONS);
|
bind(Gui.ICONS);
|
||||||
GlStateManager.enableBlend();
|
GlStateManager.enableBlend();
|
||||||
super.func_194798_c(partialTicks);
|
super.renderAttackIndicator(partialTicks);
|
||||||
post(CROSSHAIRS);
|
post(CROSSHAIRS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void func_194809_b()
|
protected void renderPotionEffects()
|
||||||
{
|
{
|
||||||
if (pre(POTION_ICONS)) return;
|
if (pre(POTION_ICONS)) return;
|
||||||
super.func_194809_b();
|
super.renderPotionEffects();
|
||||||
post(POTION_ICONS);
|
post(POTION_ICONS);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void renderSubtitles()
|
protected void renderSubtitles()
|
||||||
{
|
{
|
||||||
if (pre(SUBTITLES)) return;
|
if (pre(SUBTITLES)) return;
|
||||||
this.overlaySubtitle.func_195620_a();
|
this.overlaySubtitle.render();
|
||||||
post(SUBTITLES);
|
post(SUBTITLES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ public class GuiIngameForge extends GuiIngame
|
||||||
{
|
{
|
||||||
if (pre(BOSSHEALTH)) return;
|
if (pre(BOSSHEALTH)) return;
|
||||||
bind(Gui.ICONS);
|
bind(Gui.ICONS);
|
||||||
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
||||||
mc.profiler.startSection("bossHealth");
|
mc.profiler.startSection("bossHealth");
|
||||||
GlStateManager.enableBlend();
|
GlStateManager.enableBlend();
|
||||||
this.overlayBoss.renderBossHealth();
|
this.overlayBoss.renderBossHealth();
|
||||||
|
@ -255,16 +255,16 @@ public class GuiIngameForge extends GuiIngame
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void func_194800_d(float lightLevel)
|
protected void renderVignette(float lightLevel)
|
||||||
{
|
{
|
||||||
if (pre(VIGNETTE))
|
if (pre(VIGNETTE))
|
||||||
{
|
{
|
||||||
// Need to put this here, since Vanilla assumes this state after the vignette was rendered.
|
// Need to put this here, since Vanilla assumes this state after the vignette was rendered.
|
||||||
GlStateManager.enableDepth();
|
GlStateManager.enableDepthTest();
|
||||||
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
super.func_194800_d(lightLevel);
|
super.renderVignette(lightLevel);
|
||||||
post(VIGNETTE);
|
post(VIGNETTE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,13 +277,13 @@ public class GuiIngameForge extends GuiIngame
|
||||||
if (this.mc.gameSettings.thirdPersonView == 0 && !itemstack.isEmpty())
|
if (this.mc.gameSettings.thirdPersonView == 0 && !itemstack.isEmpty())
|
||||||
{
|
{
|
||||||
Item item = itemstack.getItem();
|
Item item = itemstack.getItem();
|
||||||
if (item == Blocks.field_196625_cS.func_199767_j())
|
if (item == Blocks.CARVED_PUMPKIN.asItem())
|
||||||
{
|
{
|
||||||
func_194808_p();
|
renderPumpkinOverlay();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item.renderHelmetOverlay(itemstack, mc.player, this.field_194811_H, this.field_194812_I, partialTicks);
|
item.renderHelmetOverlay(itemstack, mc.player, this.scaledWidth, this.scaledHeight, partialTicks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -324,7 +324,7 @@ public class GuiIngameForge extends GuiIngame
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void func_194805_e(float partialTicks)
|
protected void renderPortal(float partialTicks)
|
||||||
{
|
{
|
||||||
if (pre(PORTAL)) return;
|
if (pre(PORTAL)) return;
|
||||||
|
|
||||||
|
@ -332,24 +332,24 @@ public class GuiIngameForge extends GuiIngame
|
||||||
|
|
||||||
if (f1 > 0.0F)
|
if (f1 > 0.0F)
|
||||||
{
|
{
|
||||||
super.func_194805_e(f1);
|
super.renderPortal(f1);
|
||||||
}
|
}
|
||||||
|
|
||||||
post(PORTAL);
|
post(PORTAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void func_194806_b(float partialTicks)
|
protected void renderHotbar(float partialTicks)
|
||||||
{
|
{
|
||||||
if (pre(HOTBAR)) return;
|
if (pre(HOTBAR)) return;
|
||||||
|
|
||||||
if (mc.playerController.getCurrentGameType() == GameType.SPECTATOR)
|
if (mc.playerController.getCurrentGameType() == GameType.SPECTATOR)
|
||||||
{
|
{
|
||||||
this.spectatorGui.func_195622_a(partialTicks);
|
this.spectatorGui.renderTooltip(partialTicks);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
super.func_194806_b(partialTicks);
|
super.renderHotbar(partialTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
post(HOTBAR);
|
post(HOTBAR);
|
||||||
|
@ -371,7 +371,7 @@ public class GuiIngameForge extends GuiIngame
|
||||||
int top = height - right_height;
|
int top = height - right_height;
|
||||||
|
|
||||||
int air = player.getAir();
|
int air = player.getAir();
|
||||||
if (player.func_208600_a(FluidTags.field_206959_a) || air < 300)
|
if (player.areEyesInFluid(FluidTags.WATER) || air < 300)
|
||||||
{
|
{
|
||||||
int full = MathHelper.ceil((double)(air - 2) * 10.0D / 300.0D);
|
int full = MathHelper.ceil((double)(air - 2) * 10.0D / 300.0D);
|
||||||
int partial = MathHelper.ceil((double)air * 10.0D / 300.0D) - full;
|
int partial = MathHelper.ceil((double)air * 10.0D / 300.0D) - full;
|
||||||
|
@ -397,37 +397,37 @@ public class GuiIngameForge extends GuiIngame
|
||||||
|
|
||||||
EntityPlayer player = (EntityPlayer)this.mc.getRenderViewEntity();
|
EntityPlayer player = (EntityPlayer)this.mc.getRenderViewEntity();
|
||||||
int health = MathHelper.ceil(player.getHealth());
|
int health = MathHelper.ceil(player.getHealth());
|
||||||
boolean highlight = healthUpdateCounter > (long)updateCounter && (healthUpdateCounter - (long)updateCounter) / 3L %2L == 1L;
|
boolean highlight = healthUpdateCounter > (long)ticks && (healthUpdateCounter - (long)ticks) / 3L %2L == 1L;
|
||||||
|
|
||||||
if (health < this.playerHealth && player.hurtResistantTime > 0)
|
if (health < this.playerHealth && player.hurtResistantTime > 0)
|
||||||
{
|
{
|
||||||
this.lastSystemTime = Util.func_211177_b();
|
this.lastSystemTime = Util.milliTime();
|
||||||
this.healthUpdateCounter = (long)(this.updateCounter + 20);
|
this.healthUpdateCounter = (long)(this.ticks + 20);
|
||||||
}
|
}
|
||||||
else if (health > this.playerHealth && player.hurtResistantTime > 0)
|
else if (health > this.playerHealth && player.hurtResistantTime > 0)
|
||||||
{
|
{
|
||||||
this.lastSystemTime = Util.func_211177_b();
|
this.lastSystemTime = Util.milliTime();
|
||||||
this.healthUpdateCounter = (long)(this.updateCounter + 10);
|
this.healthUpdateCounter = (long)(this.ticks + 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Util.func_211177_b() - this.lastSystemTime > 1000L)
|
if (Util.milliTime() - this.lastSystemTime > 1000L)
|
||||||
{
|
{
|
||||||
this.playerHealth = health;
|
this.playerHealth = health;
|
||||||
this.lastPlayerHealth = health;
|
this.lastPlayerHealth = health;
|
||||||
this.lastSystemTime = Util.func_211177_b();
|
this.lastSystemTime = Util.milliTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.playerHealth = health;
|
this.playerHealth = health;
|
||||||
int healthLast = this.lastPlayerHealth;
|
int healthLast = this.lastPlayerHealth;
|
||||||
|
|
||||||
IAttributeInstance attrMaxHealth = player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH);
|
IAttributeInstance attrMaxHealth = player.getAttribute(SharedMonsterAttributes.MAX_HEALTH);
|
||||||
float healthMax = (float)attrMaxHealth.getAttributeValue();
|
float healthMax = (float)attrMaxHealth.getValue();
|
||||||
float absorb = MathHelper.ceil(player.getAbsorptionAmount());
|
float absorb = MathHelper.ceil(player.getAbsorptionAmount());
|
||||||
|
|
||||||
int healthRows = MathHelper.ceil((healthMax + absorb) / 2.0F / 10.0F);
|
int healthRows = MathHelper.ceil((healthMax + absorb) / 2.0F / 10.0F);
|
||||||
int rowHeight = Math.max(10 - (healthRows - 2), 3);
|
int rowHeight = Math.max(10 - (healthRows - 2), 3);
|
||||||
|
|
||||||
this.rand.setSeed((long)(updateCounter * 312871));
|
this.rand.setSeed((long)(ticks * 312871));
|
||||||
|
|
||||||
int left = width / 2 - 91;
|
int left = width / 2 - 91;
|
||||||
int top = height - left_height;
|
int top = height - left_height;
|
||||||
|
@ -437,10 +437,10 @@ public class GuiIngameForge extends GuiIngame
|
||||||
int regen = -1;
|
int regen = -1;
|
||||||
if (player.isPotionActive(MobEffects.REGENERATION))
|
if (player.isPotionActive(MobEffects.REGENERATION))
|
||||||
{
|
{
|
||||||
regen = updateCounter % 25;
|
regen = ticks % 25;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int TOP = 9 * (mc.world.getWorldInfo().isHardcoreModeEnabled() ? 5 : 0);
|
final int TOP = 9 * (mc.world.getWorldInfo().isHardcore() ? 5 : 0);
|
||||||
final int BACKGROUND = (highlight ? 25 : 16);
|
final int BACKGROUND = (highlight ? 25 : 16);
|
||||||
int MARGIN = 16;
|
int MARGIN = 16;
|
||||||
if (player.isPotionActive(MobEffects.POISON)) MARGIN += 36;
|
if (player.isPotionActive(MobEffects.POISON)) MARGIN += 36;
|
||||||
|
@ -524,7 +524,7 @@ public class GuiIngameForge extends GuiIngame
|
||||||
}
|
}
|
||||||
if (unused) background = 1; //Probably should be a += 1 but vanilla never uses this
|
if (unused) background = 1; //Probably should be a += 1 but vanilla never uses this
|
||||||
|
|
||||||
if (player.getFoodStats().getSaturationLevel() <= 0.0F && updateCounter % (level * 3 + 1) == 0)
|
if (player.getFoodStats().getSaturationLevel() <= 0.0F && ticks % (level * 3 + 1) == 0)
|
||||||
{
|
{
|
||||||
y = top + (rand.nextInt(3) - 1);
|
y = top + (rand.nextInt(3) - 1);
|
||||||
}
|
}
|
||||||
|
@ -546,8 +546,8 @@ public class GuiIngameForge extends GuiIngame
|
||||||
if (mc.player.getSleepTimer() > 0)
|
if (mc.player.getSleepTimer() > 0)
|
||||||
{
|
{
|
||||||
mc.profiler.startSection("sleep");
|
mc.profiler.startSection("sleep");
|
||||||
GlStateManager.disableDepth();
|
GlStateManager.disableDepthTest();
|
||||||
GlStateManager.disableAlpha();
|
GlStateManager.disableAlphaTest();
|
||||||
int sleepTime = mc.player.getSleepTimer();
|
int sleepTime = mc.player.getSleepTimer();
|
||||||
float opacity = (float)sleepTime / 100.0F;
|
float opacity = (float)sleepTime / 100.0F;
|
||||||
|
|
||||||
|
@ -558,8 +558,8 @@ public class GuiIngameForge extends GuiIngame
|
||||||
|
|
||||||
int color = (int)(220.0F * opacity) << 24 | 1052704;
|
int color = (int)(220.0F * opacity) << 24 | 1052704;
|
||||||
drawRect(0, 0, width, height, color);
|
drawRect(0, 0, width, height, color);
|
||||||
GlStateManager.enableAlpha();
|
GlStateManager.enableAlphaTest();
|
||||||
GlStateManager.enableDepth();
|
GlStateManager.enableDepthTest();
|
||||||
mc.profiler.endSection();
|
mc.profiler.endSection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -568,28 +568,28 @@ public class GuiIngameForge extends GuiIngame
|
||||||
{
|
{
|
||||||
bind(ICONS);
|
bind(ICONS);
|
||||||
if (pre(EXPERIENCE)) return;
|
if (pre(EXPERIENCE)) return;
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
GlStateManager.disableBlend();
|
GlStateManager.disableBlend();
|
||||||
|
|
||||||
if (mc.playerController.gameIsSurvivalOrAdventure())
|
if (mc.playerController.gameIsSurvivalOrAdventure())
|
||||||
{
|
{
|
||||||
super.func_194804_b(x);
|
super.renderExpBar(x);
|
||||||
}
|
}
|
||||||
GlStateManager.enableBlend();
|
GlStateManager.enableBlend();
|
||||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
|
||||||
post(EXPERIENCE);
|
post(EXPERIENCE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void func_194803_a(int x)
|
public void renderHorseJumpBar(int x)
|
||||||
{
|
{
|
||||||
bind(ICONS);
|
bind(ICONS);
|
||||||
if (pre(JUMPBAR)) return;
|
if (pre(JUMPBAR)) return;
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
GlStateManager.disableBlend();
|
GlStateManager.disableBlend();
|
||||||
|
|
||||||
super.func_194803_a(x);
|
super.renderHorseJumpBar(x);
|
||||||
|
|
||||||
GlStateManager.enableBlend();
|
GlStateManager.enableBlend();
|
||||||
mc.profiler.endSection();
|
mc.profiler.endSection();
|
||||||
|
@ -601,13 +601,13 @@ public class GuiIngameForge extends GuiIngame
|
||||||
protected void renderHUDText(int width, int height)
|
protected void renderHUDText(int width, int height)
|
||||||
{
|
{
|
||||||
mc.profiler.startSection("forgeHudText");
|
mc.profiler.startSection("forgeHudText");
|
||||||
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
OpenGlHelper.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||||
ArrayList<String> listL = new ArrayList<String>();
|
ArrayList<String> listL = new ArrayList<String>();
|
||||||
ArrayList<String> listR = new ArrayList<String>();
|
ArrayList<String> listR = new ArrayList<String>();
|
||||||
|
|
||||||
if (mc.isDemo())
|
if (mc.isDemo())
|
||||||
{
|
{
|
||||||
long time = mc.world.getTotalWorldTime();
|
long time = mc.world.getGameTime();
|
||||||
if (time >= 120500L)
|
if (time >= 120500L)
|
||||||
{
|
{
|
||||||
listR.add(I18n.format("demo.demoExpired"));
|
listR.add(I18n.format("demo.demoExpired"));
|
||||||
|
@ -674,9 +674,9 @@ public class GuiIngameForge extends GuiIngame
|
||||||
if (opacity > 0)
|
if (opacity > 0)
|
||||||
{
|
{
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
GlStateManager.translate((float)(width / 2), (float)(height - 68), 0.0F);
|
GlStateManager.translatef((float)(width / 2), (float)(height - 68), 0.0F);
|
||||||
GlStateManager.enableBlend();
|
GlStateManager.enableBlend();
|
||||||
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
||||||
int color = (animateOverlayMessageColor ? Color.HSBtoRGB(hue / 50.0F, 0.7F, 0.6F) & WHITE : WHITE);
|
int color = (animateOverlayMessageColor ? Color.HSBtoRGB(hue / 50.0F, 0.7F, 0.6F) & WHITE : WHITE);
|
||||||
fontrenderer.drawStringWithShadow(overlayMessage, -fontrenderer.getStringWidth(overlayMessage) / 2, -4, color | (opacity << 24));
|
fontrenderer.drawStringWithShadow(overlayMessage, -fontrenderer.getStringWidth(overlayMessage) / 2, -4, color | (opacity << 24));
|
||||||
GlStateManager.disableBlend();
|
GlStateManager.disableBlend();
|
||||||
|
@ -707,16 +707,16 @@ public class GuiIngameForge extends GuiIngame
|
||||||
if (opacity > 8)
|
if (opacity > 8)
|
||||||
{
|
{
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
GlStateManager.translate((float)(width / 2), (float)(height / 2), 0.0F);
|
GlStateManager.translatef((float)(width / 2), (float)(height / 2), 0.0F);
|
||||||
GlStateManager.enableBlend();
|
GlStateManager.enableBlend();
|
||||||
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
GlStateManager.scale(4.0F, 4.0F, 4.0F);
|
GlStateManager.scalef(4.0F, 4.0F, 4.0F);
|
||||||
int l = opacity << 24 & -16777216;
|
int l = opacity << 24 & -16777216;
|
||||||
this.getFontRenderer().drawStringWithShadow(this.displayedTitle, (float)(-this.getFontRenderer().getStringWidth(this.displayedTitle) / 2), -10.0F, 16777215 | l);
|
this.getFontRenderer().drawStringWithShadow(this.displayedTitle, (float)(-this.getFontRenderer().getStringWidth(this.displayedTitle) / 2), -10.0F, 16777215 | l);
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
GlStateManager.scale(2.0F, 2.0F, 2.0F);
|
GlStateManager.scalef(2.0F, 2.0F, 2.0F);
|
||||||
this.getFontRenderer().drawStringWithShadow(this.displayedSubTitle, (float)(-this.getFontRenderer().getStringWidth(this.displayedSubTitle) / 2), 5.0F, 16777215 | l);
|
this.getFontRenderer().drawStringWithShadow(this.displayedSubTitle, (float)(-this.getFontRenderer().getStringWidth(this.displayedSubTitle) / 2), 5.0F, 16777215 | l);
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
GlStateManager.disableBlend();
|
GlStateManager.disableBlend();
|
||||||
|
@ -735,8 +735,8 @@ public class GuiIngameForge extends GuiIngame
|
||||||
if (MinecraftForge.EVENT_BUS.post(event)) return;
|
if (MinecraftForge.EVENT_BUS.post(event)) return;
|
||||||
|
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
GlStateManager.translate((float) event.getPosX(), (float) event.getPosY(), 0.0F);
|
GlStateManager.translatef((float) event.getPosX(), (float) event.getPosY(), 0.0F);
|
||||||
persistantChatGUI.drawChat(updateCounter);
|
persistantChatGUI.drawChat(ticks);
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
|
|
||||||
post(CHAT);
|
post(CHAT);
|
||||||
|
@ -751,14 +751,14 @@ public class GuiIngameForge extends GuiIngame
|
||||||
|
|
||||||
if (mc.gameSettings.keyBindPlayerList.isKeyDown() && (!mc.isIntegratedServerRunning() || handler.getPlayerInfoMap().size() > 1 || scoreobjective != null))
|
if (mc.gameSettings.keyBindPlayerList.isKeyDown() && (!mc.isIntegratedServerRunning() || handler.getPlayerInfoMap().size() > 1 || scoreobjective != null))
|
||||||
{
|
{
|
||||||
this.overlayPlayerList.updatePlayerList(true);
|
this.overlayPlayerList.setVisible(true);
|
||||||
if (pre(PLAYER_LIST)) return;
|
if (pre(PLAYER_LIST)) return;
|
||||||
this.overlayPlayerList.renderPlayerlist(width, this.mc.world.getScoreboard(), scoreobjective);
|
this.overlayPlayerList.renderPlayerlist(width, this.mc.world.getScoreboard(), scoreobjective);
|
||||||
post(PLAYER_LIST);
|
post(PLAYER_LIST);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.overlayPlayerList.updatePlayerList(false);
|
this.overlayPlayerList.setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -836,10 +836,10 @@ public class GuiIngameForge extends GuiIngame
|
||||||
this.mc = mc;
|
this.mc = mc;
|
||||||
}
|
}
|
||||||
@Override protected void renderDebugInfoLeft(){}
|
@Override protected void renderDebugInfoLeft(){}
|
||||||
@Override protected void func_194819_c(){}
|
@Override protected void renderDebugInfoRight(){}
|
||||||
private List<String> getLeft()
|
private List<String> getLeft()
|
||||||
{
|
{
|
||||||
List<String> ret = this.func_209011_c();
|
List<String> ret = this.call();
|
||||||
ret.add("");
|
ret.add("");
|
||||||
ret.add("Debug: Pie [shift]: " + (this.mc.gameSettings.showDebugProfilerChart ? "visible" : "hidden") + " FPS [alt]: " + (this.mc.gameSettings.showLagometer ? "visible" : "hidden"));
|
ret.add("Debug: Pie [shift]: " + (this.mc.gameSettings.showDebugProfilerChart ? "visible" : "hidden") + " FPS [alt]: " + (this.mc.gameSettings.showLagometer ? "visible" : "hidden"));
|
||||||
ret.add("For help: press F3 + Q");
|
ret.add("For help: press F3 + Q");
|
||||||
|
|
|
@ -50,13 +50,13 @@ public class ItemModelMesherForge extends ItemModelMesher
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nullable
|
@Nullable
|
||||||
public IBakedModel func_199312_b(Item item)
|
public IBakedModel getItemModel(Item item)
|
||||||
{
|
{
|
||||||
return models.get(item.delegate);
|
return models.get(item.delegate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void func_199311_a(Item item, ModelResourceLocation location)
|
public void register(Item item, ModelResourceLocation location)
|
||||||
{
|
{
|
||||||
IRegistryDelegate<Item> key = item.delegate;
|
IRegistryDelegate<Item> key = item.delegate;
|
||||||
locations.put(key, location);
|
locations.put(key, location);
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class MinecraftForgeClient
|
||||||
*/
|
*/
|
||||||
public static Locale getLocale()
|
public static Locale getLocale()
|
||||||
{
|
{
|
||||||
return Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getJavaLocale();
|
return Minecraft.getInstance().getLanguageManager().getCurrentLanguage().getJavaLocale();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static BitSet stencilBits = new BitSet(8);
|
private static BitSet stencilBits = new BitSet(8);
|
||||||
|
|
|
@ -25,6 +25,8 @@ import net.minecraft.entity.Entity;
|
||||||
import net.minecraftforge.eventbus.api.Cancelable;
|
import net.minecraftforge.eventbus.api.Cancelable;
|
||||||
import net.minecraftforge.eventbus.api.Event;
|
import net.minecraftforge.eventbus.api.Event;
|
||||||
|
|
||||||
|
import net.minecraftforge.eventbus.api.Event.HasResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event that hooks into EntityRenderer, allowing any feature to customize visual attributes
|
* Event that hooks into EntityRenderer, allowing any feature to customize visual attributes
|
||||||
* the player sees.
|
* the player sees.
|
||||||
|
|
|
@ -44,4 +44,4 @@ public class PlayerSPPushOutOfBlocksEvent extends PlayerEvent
|
||||||
|
|
||||||
public AxisAlignedBB getEntityBoundingBox() { return entityBoundingBox; }
|
public AxisAlignedBB getEntityBoundingBox() { return entityBoundingBox; }
|
||||||
public void setEntityBoundingBox(@Nonnull AxisAlignedBB entityBoundingBox) { this.entityBoundingBox = entityBoundingBox; }
|
public void setEntityBoundingBox(@Nonnull AxisAlignedBB entityBoundingBox) { this.entityBoundingBox = entityBoundingBox; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,4 +135,4 @@ public abstract class RenderPlayerEvent extends PlayerEvent
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,4 +29,4 @@ public class PlaySoundSourceEvent extends SoundSourceEvent
|
||||||
{
|
{
|
||||||
super(manager, sound, uuid);
|
super(manager, sound, uuid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,4 +29,4 @@ public class PlayStreamingSourceEvent extends SoundSourceEvent
|
||||||
{
|
{
|
||||||
super(manager, sound, uuid);
|
super(manager, sound, uuid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,12 +18,12 @@ public interface IForgeKeybinding
|
||||||
*/
|
*/
|
||||||
default boolean isActiveAndMatches(InputMappings.Input keyCode)
|
default boolean isActiveAndMatches(InputMappings.Input keyCode)
|
||||||
{
|
{
|
||||||
return keyCode.func_197937_c() != 0 && keyCode.equals(getKey()) && getKeyConflictContext().isActive() && getKeyModifier().isActive(getKeyConflictContext());
|
return keyCode.getKeyCode() != 0 && keyCode.equals(getKey()) && getKeyConflictContext().isActive() && getKeyModifier().isActive(getKeyConflictContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
default void setToDefault()
|
default void setToDefault()
|
||||||
{
|
{
|
||||||
setKeyModifierAndCode(getKeyModifierDefault(), getKeyBinding().func_197977_i());
|
setKeyModifierAndCode(getKeyModifierDefault(), getKeyBinding().getDefault());
|
||||||
}
|
}
|
||||||
|
|
||||||
void setKeyConflictContext(IKeyConflictContext keyConflictContext);
|
void setKeyConflictContext(IKeyConflictContext keyConflictContext);
|
||||||
|
|
|
@ -61,15 +61,15 @@ public class NotificationModUpdateScreen extends GuiScreen
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawScreen(int mouseX, int mouseY, float partialTicks)
|
public void render(int mouseX, int mouseY, float partialTicks)
|
||||||
{
|
{
|
||||||
if (showNotification == null || !showNotification.shouldDraw() || ForgeMod.disableVersionCheck)
|
if (showNotification == null || !showNotification.shouldDraw() || ForgeMod.disableVersionCheck)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Minecraft.getMinecraft().getTextureManager().bindTexture(VERSION_CHECK_ICONS);
|
Minecraft.getInstance().getTextureManager().bindTexture(VERSION_CHECK_ICONS);
|
||||||
GlStateManager.color(1, 1, 1, 1);
|
GlStateManager.color4f(1, 1, 1, 1);
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
|
|
||||||
int x = modButton.x;
|
int x = modButton.x;
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class BakedItemModel implements IBakedModel
|
||||||
@Override public ItemOverrideList getOverrides() { return overrides; }
|
@Override public ItemOverrideList getOverrides() { return overrides; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BakedQuad> func_200117_a(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
|
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
|
||||||
{
|
{
|
||||||
if (side == null)
|
if (side == null)
|
||||||
{
|
{
|
||||||
|
@ -105,7 +105,7 @@ public class BakedItemModel implements IBakedModel
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BakedQuad> func_200117_a (@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
|
public List<BakedQuad> getQuads (@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
|
||||||
{
|
{
|
||||||
if(side == null)
|
if(side == null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,9 +43,9 @@ public abstract class BakedModelWrapper<T extends IBakedModel> implements IBaked
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BakedQuad> func_200117_a(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
|
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
|
||||||
{
|
{
|
||||||
return originalModel.func_200117_a(state, side, rand);
|
return originalModel.getQuads(state, side, rand);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -68,9 +68,9 @@ final class FancyMissingModel implements IUnbakedModel
|
||||||
m.m33 = 1;
|
m.m33 = 1;
|
||||||
m.setTranslation(new Vector3f(1, 1 + 1f / 0x100, 0));
|
m.setTranslation(new Vector3f(1, 1 + 1f / 0x100, 0));
|
||||||
return new SimpleModelFontRenderer(
|
return new SimpleModelFontRenderer(
|
||||||
Minecraft.getMinecraft().gameSettings,
|
Minecraft.getInstance().gameSettings,
|
||||||
font,
|
font,
|
||||||
Minecraft.getMinecraft().getTextureManager(),
|
Minecraft.getInstance().getTextureManager(),
|
||||||
false,
|
false,
|
||||||
m,
|
m,
|
||||||
format
|
format
|
||||||
|
@ -92,15 +92,15 @@ final class FancyMissingModel implements IUnbakedModel
|
||||||
this.missingModel = missingModel;
|
this.missingModel = missingModel;
|
||||||
this.message = message;
|
this.message = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ResourceLocation> func_209559_a(Function<ResourceLocation, IUnbakedModel> p_209559_1_, Set<String> p_209559_2_)
|
public Collection<ResourceLocation> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextureErrors)
|
||||||
{
|
{
|
||||||
return ImmutableList.of(font2);
|
return ImmutableList.of(font2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ResourceLocation> getOverrideLocations()
|
public Collection<ResourceLocation> getOverrideLocations()
|
||||||
{
|
{
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,7 @@ final class FancyMissingModel implements IUnbakedModel
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BakedQuad> func_200117_a(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
|
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
|
||||||
{
|
{
|
||||||
if (side == null)
|
if (side == null)
|
||||||
{
|
{
|
||||||
|
@ -161,16 +161,16 @@ final class FancyMissingModel implements IUnbakedModel
|
||||||
}
|
}
|
||||||
for (int y = 0; y < splitLines.size(); y++)
|
for (int y = 0; y < splitLines.size(); y++)
|
||||||
{
|
{
|
||||||
fontRenderer.func_211126_b(splitLines.get(y), 0, ((y - splitLines.size() / 2f) * fontRenderer.FONT_HEIGHT) + 0x40, 0xFF00FFFF);
|
fontRenderer.drawString(splitLines.get(y), 0, ((y - splitLines.size() / 2f) * fontRenderer.FONT_HEIGHT) + 0x40, 0xFF00FFFF);
|
||||||
}
|
}
|
||||||
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
|
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
|
||||||
builder.addAll(missingModel.func_200117_a (state, side, rand));
|
builder.addAll(missingModel.getQuads (state, side, rand));
|
||||||
builder.addAll(fontRenderer.build());
|
builder.addAll(fontRenderer.build());
|
||||||
quads = builder.build();
|
quads = builder.build();
|
||||||
}
|
}
|
||||||
return quads;
|
return quads;
|
||||||
}
|
}
|
||||||
return missingModel.func_200117_a (state, side, rand);
|
return missingModel.getQuads (state, side, rand);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -186,7 +186,7 @@ final class FancyMissingModel implements IUnbakedModel
|
||||||
public TextureAtlasSprite getParticleTexture() { return fontTexture; }
|
public TextureAtlasSprite getParticleTexture() { return fontTexture; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemOverrideList getOverrides() { return ItemOverrideList.NONE; }
|
public ItemOverrideList getOverrides() { return ItemOverrideList.EMPTY; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType)
|
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType)
|
||||||
|
@ -230,9 +230,9 @@ final class FancyMissingModel implements IUnbakedModel
|
||||||
}
|
}
|
||||||
if (big != this.big)
|
if (big != this.big)
|
||||||
{
|
{
|
||||||
return Pair.of(otherModel, transform.getMatrix());
|
return Pair.of(otherModel, transform.getMatrixVec());
|
||||||
}
|
}
|
||||||
return Pair.of(this, transform.getMatrix());
|
return Pair.of(this, transform.getMatrixVec());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,14 +31,14 @@ import net.minecraft.util.ResourceLocation;
|
||||||
public interface ICustomModelLoader extends ISelectiveResourceReloadListener
|
public interface ICustomModelLoader extends ISelectiveResourceReloadListener
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
void func_195410_a(IResourceManager resourceManager);
|
void onResourceManagerReload(IResourceManager resourceManager);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
default void onResourceManagerReload(IResourceManager resourceManager, Predicate<IResourceType> resourcePredicate)
|
default void onResourceManagerReload(IResourceManager resourceManager, Predicate<IResourceType> resourcePredicate)
|
||||||
{
|
{
|
||||||
if (resourcePredicate.test(VanillaResourceType.MODELS))
|
if (resourcePredicate.test(VanillaResourceType.MODELS))
|
||||||
{
|
{
|
||||||
func_195410_a(resourceManager);
|
onResourceManagerReload(resourceManager);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ import net.minecraftforge.common.model.animation.IClip;
|
||||||
public interface IModel<T extends IModel<T>>
|
public interface IModel<T extends IModel<T>>
|
||||||
{
|
{
|
||||||
@Nullable
|
@Nullable
|
||||||
IBakedModel bake(Function<ResourceLocation, IUnbakedModel> p_209558_1_, Function<ResourceLocation, TextureAtlasSprite> p_209558_2_, IModelState state, boolean uvlock, VertexFormat format);
|
IBakedModel bake(Function<ResourceLocation, IUnbakedModel> modelGetter, Function<ResourceLocation, TextureAtlasSprite> spriteGetter, IModelState state, boolean uvlock, VertexFormat format);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Default state this model will be baked with.
|
* Default state this model will be baked with.
|
||||||
|
|
|
@ -64,7 +64,7 @@ public final class ItemLayerModel implements IUnbakedModel
|
||||||
|
|
||||||
public ItemLayerModel(ImmutableList<ResourceLocation> textures)
|
public ItemLayerModel(ImmutableList<ResourceLocation> textures)
|
||||||
{
|
{
|
||||||
this(textures, ItemOverrideList.NONE);
|
this(textures, ItemOverrideList.EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemLayerModel(ImmutableList<ResourceLocation> textures, ItemOverrideList overrides)
|
public ItemLayerModel(ImmutableList<ResourceLocation> textures, ItemOverrideList overrides)
|
||||||
|
@ -75,7 +75,7 @@ public final class ItemLayerModel implements IUnbakedModel
|
||||||
|
|
||||||
public ItemLayerModel(ModelBlock model)
|
public ItemLayerModel(ModelBlock model)
|
||||||
{
|
{
|
||||||
this(getTextures(model), model.func_209568_a(model, ModelLoader.defaultModelGetter(), ModelLoader.defaultTextureGetter()));
|
this(getTextures(model), model.getOverrides(model, ModelLoader.defaultModelGetter(), ModelLoader.defaultTextureGetter()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ImmutableList<ResourceLocation> getTextures(ModelBlock model)
|
private static ImmutableList<ResourceLocation> getTextures(ModelBlock model)
|
||||||
|
@ -87,17 +87,17 @@ public final class ItemLayerModel implements IUnbakedModel
|
||||||
}
|
}
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ResourceLocation> func_209559_a(Function<ResourceLocation, IUnbakedModel> p_209559_1_, Set<String> p_209559_2_)
|
public Collection<ResourceLocation> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextureErrors)
|
||||||
{
|
{
|
||||||
return textures;
|
return textures;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ResourceLocation> getOverrideLocations()
|
public Collection<ResourceLocation> getOverrideLocations()
|
||||||
{
|
{
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -117,9 +117,9 @@ public final class ItemLayerModel implements IUnbakedModel
|
||||||
}
|
}
|
||||||
return new ItemLayerModel(builder.build(), overrides);
|
return new ItemLayerModel(builder.build(), overrides);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBakedModel bake(Function<ResourceLocation, IUnbakedModel> p_209558_1_, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter, IModelState state, boolean p_209558_4_, VertexFormat format) {
|
public IBakedModel bake(Function<ResourceLocation, IUnbakedModel> modelGetter, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter, IModelState state, boolean uvlock, VertexFormat format) {
|
||||||
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
|
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
|
||||||
Optional<TRSRTransformation> transform = state.apply(Optional.empty());
|
Optional<TRSRTransformation> transform = state.apply(Optional.empty());
|
||||||
for(int i = 0; i < textures.size(); i++)
|
for(int i = 0; i < textures.size(); i++)
|
||||||
|
@ -136,8 +136,8 @@ public final class ItemLayerModel implements IUnbakedModel
|
||||||
{
|
{
|
||||||
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
|
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
|
||||||
|
|
||||||
int uMax = sprite.getIconWidth();
|
int uMax = sprite.getWidth();
|
||||||
int vMax = sprite.getIconHeight();
|
int vMax = sprite.getHeight();
|
||||||
|
|
||||||
FaceData faceData = new FaceData(uMax, vMax);
|
FaceData faceData = new FaceData(uMax, vMax);
|
||||||
boolean translucent = false;
|
boolean translucent = false;
|
||||||
|
@ -343,8 +343,8 @@ public final class ItemLayerModel implements IUnbakedModel
|
||||||
{
|
{
|
||||||
final float eps = 1e-2f;
|
final float eps = 1e-2f;
|
||||||
|
|
||||||
int width = sprite.getIconWidth();
|
int width = sprite.getWidth();
|
||||||
int height = sprite.getIconHeight();
|
int height = sprite.getHeight();
|
||||||
|
|
||||||
float x0 = (float) u / width;
|
float x0 = (float) u / width;
|
||||||
float y0 = (float) v / height;
|
float y0 = (float) v / height;
|
||||||
|
@ -424,7 +424,7 @@ public final class ItemLayerModel implements IUnbakedModel
|
||||||
vec.y = y;
|
vec.y = y;
|
||||||
vec.z = z;
|
vec.z = z;
|
||||||
vec.w = 1;
|
vec.w = 1;
|
||||||
transform.get().getMatrix().transform(vec);
|
transform.get().getMatrixVec().transform(vec);
|
||||||
builder.put(e, vec.x, vec.y, vec.z, vec.w);
|
builder.put(e, vec.x, vec.y, vec.z, vec.w);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -455,7 +455,7 @@ public final class ItemLayerModel implements IUnbakedModel
|
||||||
INSTANCE;
|
INSTANCE;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void func_195410_a(IResourceManager resourceManager) {}
|
public void onResourceManagerReload(IResourceManager resourceManager) {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accepts(ResourceLocation modelLocation)
|
public boolean accepts(ResourceLocation modelLocation)
|
||||||
|
|
|
@ -80,8 +80,8 @@ public final class ItemTextureQuadConverter
|
||||||
*/
|
*/
|
||||||
public static List<UnpackedBakedQuad> convertTextureHorizontal(VertexFormat format, TRSRTransformation transform, TextureAtlasSprite template, TextureAtlasSprite sprite, float z, EnumFacing facing, int color, int tint)
|
public static List<UnpackedBakedQuad> convertTextureHorizontal(VertexFormat format, TRSRTransformation transform, TextureAtlasSprite template, TextureAtlasSprite sprite, float z, EnumFacing facing, int color, int tint)
|
||||||
{
|
{
|
||||||
int w = template.getIconWidth();
|
int w = template.getWidth();
|
||||||
int h = template.getIconHeight();
|
int h = template.getHeight();
|
||||||
float wScale = 16f / (float)w;
|
float wScale = 16f / (float)w;
|
||||||
float hScale = 16f / (float)h;
|
float hScale = 16f / (float)h;
|
||||||
List<UnpackedBakedQuad> quads = Lists.newArrayList();
|
List<UnpackedBakedQuad> quads = Lists.newArrayList();
|
||||||
|
@ -93,7 +93,7 @@ public final class ItemTextureQuadConverter
|
||||||
for (int x = 0; x < w; x++)
|
for (int x = 0; x < w; x++)
|
||||||
{
|
{
|
||||||
// current pixel
|
// current pixel
|
||||||
boolean isVisible = !template.func_195662_a(0, x, y);
|
boolean isVisible = !template.isPixelTransparent(0, x, y);
|
||||||
|
|
||||||
// no current quad but found a new one
|
// no current quad but found a new one
|
||||||
if (start < 0 && isVisible)
|
if (start < 0 && isVisible)
|
||||||
|
@ -111,7 +111,7 @@ public final class ItemTextureQuadConverter
|
||||||
{
|
{
|
||||||
for (int i = 0; i < w; i++)
|
for (int i = 0; i < w; i++)
|
||||||
{
|
{
|
||||||
if (template.func_195662_a(0, i, y) != template.func_195662_a(0, i, endY))
|
if (template.isPixelTransparent(0, i, y) != template.isPixelTransparent(0, i, endY))
|
||||||
{
|
{
|
||||||
sameRow = false;
|
sameRow = false;
|
||||||
break;
|
break;
|
||||||
|
@ -158,8 +158,8 @@ public final class ItemTextureQuadConverter
|
||||||
*/
|
*/
|
||||||
public static List<UnpackedBakedQuad> convertTextureVertical(VertexFormat format, TRSRTransformation transform, TextureAtlasSprite template, TextureAtlasSprite sprite, float z, EnumFacing facing, int color, int tint)
|
public static List<UnpackedBakedQuad> convertTextureVertical(VertexFormat format, TRSRTransformation transform, TextureAtlasSprite template, TextureAtlasSprite sprite, float z, EnumFacing facing, int color, int tint)
|
||||||
{
|
{
|
||||||
int w = template.getIconWidth();
|
int w = template.getWidth();
|
||||||
int h = template.getIconHeight();
|
int h = template.getHeight();
|
||||||
float wScale = 16f / (float)w;
|
float wScale = 16f / (float)w;
|
||||||
float hScale = 16f / (float)h;
|
float hScale = 16f / (float)h;
|
||||||
List<UnpackedBakedQuad> quads = Lists.newArrayList();
|
List<UnpackedBakedQuad> quads = Lists.newArrayList();
|
||||||
|
@ -171,7 +171,7 @@ public final class ItemTextureQuadConverter
|
||||||
for (int y = 0; y < h; y++)
|
for (int y = 0; y < h; y++)
|
||||||
{
|
{
|
||||||
// current pixel
|
// current pixel
|
||||||
boolean isVisible = !sprite.func_195662_a(0, x, y);
|
boolean isVisible = !sprite.isPixelTransparent(0, x, y);
|
||||||
|
|
||||||
// no current quad but found a new one
|
// no current quad but found a new one
|
||||||
if (start < 0 && isVisible)
|
if (start < 0 && isVisible)
|
||||||
|
@ -189,7 +189,7 @@ public final class ItemTextureQuadConverter
|
||||||
{
|
{
|
||||||
for (int i = 0; i < h; i++)
|
for (int i = 0; i < h; i++)
|
||||||
{
|
{
|
||||||
if (sprite.func_195662_a(0, x, i) != sprite.func_195662_a(0, endX, i))
|
if (sprite.isPixelTransparent(0, x, i) != sprite.isPixelTransparent(0, endX, i))
|
||||||
{
|
{
|
||||||
sameColumn = false;
|
sameColumn = false;
|
||||||
break;
|
break;
|
||||||
|
@ -305,7 +305,7 @@ public final class ItemTextureQuadConverter
|
||||||
vec.y = y;
|
vec.y = y;
|
||||||
vec.z = z;
|
vec.z = z;
|
||||||
vec.w = 1;
|
vec.w = 1;
|
||||||
transform.getMatrix().transform(vec);
|
transform.getMatrixVec().transform(vec);
|
||||||
builder.put(e, vec.x, vec.y, vec.z, vec.w);
|
builder.put(e, vec.x, vec.y, vec.z, vec.w);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -111,7 +111,7 @@ public final class ModelDynBucket implements IUnbakedModel
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ResourceLocation> func_209559_a(Function<ResourceLocation, IUnbakedModel> p_209559_1_, Set<String> p_209559_2_)
|
public Collection<ResourceLocation> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextureErrors)
|
||||||
{
|
{
|
||||||
ImmutableSet.Builder<ResourceLocation> builder = ImmutableSet.builder();
|
ImmutableSet.Builder<ResourceLocation> builder = ImmutableSet.builder();
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ public final class ModelDynBucket implements IUnbakedModel
|
||||||
// build base (insidest)
|
// build base (insidest)
|
||||||
IBakedModel model = (new ItemLayerModel(ImmutableList.of(baseLocation))).bake(modelGetter, bakedTextureGetter, state, uvlock, format);
|
IBakedModel model = (new ItemLayerModel(ImmutableList.of(baseLocation))).bake(modelGetter, bakedTextureGetter, state, uvlock, format);
|
||||||
random.setSeed(42);
|
random.setSeed(42);
|
||||||
builder.addAll(model.func_200117_a(null, null, random));
|
builder.addAll(model.getQuads(null, null, random));
|
||||||
particleSprite = model.getParticleTexture();
|
particleSprite = model.getParticleTexture();
|
||||||
}
|
}
|
||||||
if (liquidLocation != null && fluidSprite != null)
|
if (liquidLocation != null && fluidSprite != null)
|
||||||
|
@ -260,7 +260,7 @@ public final class ModelDynBucket implements IUnbakedModel
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return Minecraft.getMinecraft().func_195551_G().func_199002_a(resourceLocation);
|
return Minecraft.getInstance().getResourceManager().getResource(resourceLocation);
|
||||||
}
|
}
|
||||||
catch (IOException ignored)
|
catch (IOException ignored)
|
||||||
{
|
{
|
||||||
|
@ -298,7 +298,7 @@ public final class ModelDynBucket implements IUnbakedModel
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void func_195410_a(IResourceManager resourceManager)
|
public void onResourceManagerReload(IResourceManager resourceManager)
|
||||||
{
|
{
|
||||||
// no need to clear cache since we create a new model instance
|
// no need to clear cache since we create a new model instance
|
||||||
}
|
}
|
||||||
|
@ -331,7 +331,7 @@ public final class ModelDynBucket implements IUnbakedModel
|
||||||
|
|
||||||
private BucketBaseSprite(IResource resource)
|
private BucketBaseSprite(IResource resource)
|
||||||
{
|
{
|
||||||
super(resource.func_199029_a(), getSizeInfo(resource), resource.func_199028_a(AnimationMetadataSection.field_195817_a));
|
super(resource.getLocation(), getSizeInfo(resource), resource.getMetadata(AnimationMetadataSection.SERIALIZER));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO Custom TAS
|
/* TODO Custom TAS
|
||||||
|
@ -373,7 +373,7 @@ public final class ModelDynBucket implements IUnbakedModel
|
||||||
|
|
||||||
private BucketCoverSprite(IResource resource)
|
private BucketCoverSprite(IResource resource)
|
||||||
{
|
{
|
||||||
super(resource.func_199029_a(), getSizeInfo(resource), resource.func_199028_a(AnimationMetadataSection.field_195817_a));
|
super(resource.getLocation(), getSizeInfo(resource), resource.getMetadata(AnimationMetadataSection.SERIALIZER));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO Custom TAS
|
/* TODO Custom TAS
|
||||||
|
@ -404,7 +404,7 @@ public final class ModelDynBucket implements IUnbakedModel
|
||||||
IResource mask = getResource(new ResourceLocation(ForgeVersion.MOD_ID, "textures/items/vanilla_bucket_cover_mask.png"))
|
IResource mask = getResource(new ResourceLocation(ForgeVersion.MOD_ID, "textures/items/vanilla_bucket_cover_mask.png"))
|
||||||
) {
|
) {
|
||||||
// use the alpha mask if it fits, otherwise leave the cover texture blank
|
// use the alpha mask if it fits, otherwise leave the cover texture blank
|
||||||
if (empty != null && mask != null && Objects.equals(empty.func_199026_d(), mask.func_199026_d()) &&
|
if (empty != null && mask != null && Objects.equals(empty.getPackName(), mask.getPackName()) &&
|
||||||
alphaMask.getIconWidth() == width && alphaMask.getIconHeight() == height)
|
alphaMask.getIconWidth() == width && alphaMask.getIconHeight() == height)
|
||||||
{
|
{
|
||||||
final int[][] oldPixels = sprite.getFrameTextureData(0);
|
final int[][] oldPixels = sprite.getFrameTextureData(0);
|
||||||
|
@ -437,7 +437,7 @@ public final class ModelDynBucket implements IUnbakedModel
|
||||||
private BakedDynBucketOverrideHandler() {}
|
private BakedDynBucketOverrideHandler() {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBakedModel func_209581_a(IBakedModel originalModel, ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entity)
|
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entity)
|
||||||
{
|
{
|
||||||
return FluidUtil.getFluidContained(stack)
|
return FluidUtil.getFluidContained(stack)
|
||||||
.map(fluidStack -> {
|
.map(fluidStack -> {
|
||||||
|
@ -450,7 +450,7 @@ public final class ModelDynBucket implements IUnbakedModel
|
||||||
{
|
{
|
||||||
IUnbakedModel parent = model.parent.process(ImmutableMap.of("fluid", name));
|
IUnbakedModel parent = model.parent.process(ImmutableMap.of("fluid", name));
|
||||||
Function<ResourceLocation, TextureAtlasSprite> textureGetter;
|
Function<ResourceLocation, TextureAtlasSprite> textureGetter;
|
||||||
textureGetter = location -> Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(location.toString());
|
textureGetter = location -> Minecraft.getInstance().getTextureMap().getAtlasSprite(location.toString());
|
||||||
|
|
||||||
IBakedModel bakedModel = parent.bake(ModelLoader.defaultModelGetter(), textureGetter, new SimpleModelState(model.transforms), false, model.format);
|
IBakedModel bakedModel = parent.bake(ModelLoader.defaultModelGetter(), textureGetter, new SimpleModelState(model.transforms), false, model.format);
|
||||||
model.cache.put(name, bakedModel);
|
model.cache.put(name, bakedModel);
|
||||||
|
|
|
@ -79,13 +79,13 @@ public final class ModelFluid implements IUnbakedModel
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ResourceLocation> func_209559_a(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> p_209559_2_)
|
public Collection<ResourceLocation> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextureErrors)
|
||||||
{
|
{
|
||||||
return fluid.getOverlay() != null
|
return fluid.getOverlay() != null
|
||||||
? ImmutableSet.of(fluid.getStill(), fluid.getFlowing(), fluid.getOverlay())
|
? ImmutableSet.of(fluid.getStill(), fluid.getFlowing(), fluid.getOverlay())
|
||||||
: ImmutableSet.of(fluid.getStill(), fluid.getFlowing());
|
: ImmutableSet.of(fluid.getStill(), fluid.getFlowing());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ResourceLocation> getOverrideLocations() {
|
public Collection<ResourceLocation> getOverrideLocations() {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
|
@ -112,7 +112,7 @@ public final class ModelFluid implements IUnbakedModel
|
||||||
INSTANCE;
|
INSTANCE;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void func_195410_a(IResourceManager resourceManager) {}
|
public void onResourceManagerReload(IResourceManager resourceManager) {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accepts(ResourceLocation modelLocation)
|
public boolean accepts(ResourceLocation modelLocation)
|
||||||
|
@ -229,7 +229,7 @@ public final class ModelFluid implements IUnbakedModel
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BakedQuad> func_200117_a(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
|
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
|
||||||
{
|
{
|
||||||
if (side != null && state instanceof IExtendedBlockState)
|
if (side != null && state instanceof IExtendedBlockState)
|
||||||
{
|
{
|
||||||
|
@ -255,10 +255,10 @@ public final class ModelFluid implements IUnbakedModel
|
||||||
key <<= 1;
|
key <<= 1;
|
||||||
key |= 1;
|
key |= 1;
|
||||||
|
|
||||||
return modelCache.getUnchecked(key).func_200117_a(state, side, rand);
|
return modelCache.getUnchecked(key).getQuads(state, side, rand);
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.func_200117_a(state, side, rand);
|
return super.getQuads(state, side, rand);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -432,7 +432,7 @@ public final class ModelFluid implements IUnbakedModel
|
||||||
if(transformation.isPresent() && !transformation.get().isIdentity())
|
if(transformation.isPresent() && !transformation.get().isIdentity())
|
||||||
{
|
{
|
||||||
Vector4f vec = new Vector4f(data);
|
Vector4f vec = new Vector4f(data);
|
||||||
transformation.get().getMatrix().transform(vec);
|
transformation.get().getMatrixVec().transform(vec);
|
||||||
vec.get(data);
|
vec.get(data);
|
||||||
}
|
}
|
||||||
builder.put(e, data);
|
builder.put(e, data);
|
||||||
|
@ -484,7 +484,7 @@ public final class ModelFluid implements IUnbakedModel
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BakedQuad> func_200117_a(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
|
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
|
||||||
{
|
{
|
||||||
return side == null ? ImmutableList.of() : faceQuads.get(side);
|
return side == null ? ImmutableList.of() : faceQuads.get(side);
|
||||||
}
|
}
|
||||||
|
@ -492,7 +492,7 @@ public final class ModelFluid implements IUnbakedModel
|
||||||
@Override
|
@Override
|
||||||
public ItemOverrideList getOverrides()
|
public ItemOverrideList getOverrides()
|
||||||
{
|
{
|
||||||
return ItemOverrideList.NONE;
|
return ItemOverrideList.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -162,45 +162,45 @@ public final class ModelLoader extends ModelBakery
|
||||||
return bakedRegistry;
|
return bakedRegistry;
|
||||||
|
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
|
|
||||||
missingModel = ModelLoaderRegistry.getMissingModel();
|
missingModel = ModelLoaderRegistry.getMissingModel();
|
||||||
stateModels.put(MODEL_MISSING, missingModel);
|
stateModels.put(MODEL_MISSING, missingModel);
|
||||||
|
|
||||||
final Set<ResourceLocation> textures = Sets.newHashSet(ModelLoaderRegistry.getTextures());
|
final Set<ResourceLocation> textures = Sets.newHashSet(ModelLoaderRegistry.getTextures());
|
||||||
textures.remove(MissingTextureSprite.func_195675_b());
|
textures.remove(MissingTextureSprite.getLocation());
|
||||||
textures.addAll(LOCATIONS_BUILTIN_TEXTURES);
|
textures.addAll(LOCATIONS_BUILTIN_TEXTURES);
|
||||||
|
|
||||||
textureMap.func_195426_a(resourceManager, textures);
|
textureMap.stitch(resourceManager, textures);
|
||||||
|
|
||||||
field_209607_C.forEach((p_209602_2_, p_209602_3_) -> {
|
field_209607_C.forEach((p_209602_2_, p_209602_3_) -> {
|
||||||
p_209602_3_.getValidStates().forEach((p_209601_3_) -> {
|
p_209602_3_.getValidStates().forEach((p_209601_3_) -> {
|
||||||
this.func_209594_a(map, BlockModelShapes.func_209553_a(p_209602_2_, p_209601_3_));
|
this.getUnbakedModel(map, BlockModelShapes.getModelLocation(p_209602_2_, p_209601_3_));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
for(ResourceLocation resourcelocation : Item.REGISTRY.getKeys()) {
|
for(ResourceLocation resourcelocation : Item.REGISTRY.getKeys()) {
|
||||||
this.func_209594_a(map, new ModelResourceLocation(resourcelocation, "inventory"));
|
this.getUnbakedModel(map, new ModelResourceLocation(resourcelocation, "inventory"));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.func_209594_a(map, new ModelResourceLocation("minecraft:trident_in_hand#inventory"));
|
this.getUnbakedModel(map, new ModelResourceLocation("minecraft:trident_in_hand#inventory"));
|
||||||
Set<String> set = Sets.<String>newLinkedHashSet();
|
Set<String> set = Sets.<String>newLinkedHashSet();
|
||||||
Set<ResourceLocation> set1 = (Set)map.values().stream().<ResourceLocation>flatMap((p_209595_2_) -> {
|
Set<ResourceLocation> set1 = (Set)map.values().stream().<ResourceLocation>flatMap((p_209595_2_) -> {
|
||||||
return p_209595_2_.func_209559_a(this::func_209597_a, set).stream();
|
return p_209595_2_.getTextures(this::getUnbakedModel, set).stream();
|
||||||
}).collect(Collectors.toSet());
|
}).collect(Collectors.toSet());
|
||||||
set1.addAll(LOCATIONS_BUILTIN_TEXTURES);
|
set1.addAll(LOCATIONS_BUILTIN_TEXTURES);
|
||||||
set.forEach((p_209588_0_) -> {
|
set.forEach((p_209588_0_) -> {
|
||||||
LOGGER.warn("Unable to resolve texture reference: {}", (Object)p_209588_0_);
|
LOGGER.warn("Unable to resolve texture reference: {}", (Object)p_209588_0_);
|
||||||
});
|
});
|
||||||
this.textureMap.func_195426_a(this.resourceManager, set1);
|
this.textureMap.stitch(this.resourceManager, set1);
|
||||||
map.forEach((p_209599_1_, p_209599_2_) -> {
|
map.forEach((p_209599_1_, p_209599_2_) -> {
|
||||||
IBakedModel ibakedmodel = p_209599_2_.func_209558_a(this::func_209597_a, this.textureMap::func_195424_a, ModelRotation.X0_Y0, false);
|
IBakedModel ibakedmodel = p_209599_2_.bake(this::getUnbakedModel, this.textureMap::getSprite, ModelRotation.X0_Y0, false);
|
||||||
if (ibakedmodel != null) {
|
if (ibakedmodel != null) {
|
||||||
this.bakedRegistry.putObject(p_209599_1_, ibakedmodel);
|
this.bakedRegistry.putObject(p_209599_1_, ibakedmodel);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
return this.bakedRegistry;
|
return this.bakedRegistry;
|
||||||
|
|
||||||
IBakedModel missingBaked = missingModel.bake(defaultModelGetter(), defaultTextureGetter(), missingModel.getDefaultState(), false, DefaultVertexFormats.ITEM);
|
IBakedModel missingBaked = missingModel.bake(defaultModelGetter(), defaultTextureGetter(), missingModel.getDefaultState(), false, DefaultVertexFormats.ITEM);
|
||||||
Map<IUnbakedModel, IBakedModel> bakedModels = Maps.newHashMap();
|
Map<IUnbakedModel, IBakedModel> bakedModels = Maps.newHashMap();
|
||||||
HashMultimap<IUnbakedModel, ModelResourceLocation> models = HashMultimap.create();
|
HashMultimap<IUnbakedModel, ModelResourceLocation> models = HashMultimap.create();
|
||||||
|
@ -356,8 +356,8 @@ public final class ModelLoader extends ModelBakery
|
||||||
|
|
||||||
private final class VanillaModelWrapper implements IUnbakedModel
|
private final class VanillaModelWrapper implements IUnbakedModel
|
||||||
{
|
{
|
||||||
private final FaceBakery faceBakery = new FaceBakery();
|
private final FaceBakery faceBakery = new FaceBakery();
|
||||||
|
|
||||||
private final ResourceLocation location;
|
private final ResourceLocation location;
|
||||||
private final ModelBlock model;
|
private final ModelBlock model;
|
||||||
private final boolean uvlock;
|
private final boolean uvlock;
|
||||||
|
@ -390,9 +390,9 @@ public final class ModelLoader extends ModelBakery
|
||||||
}
|
}
|
||||||
return ImmutableSet.copyOf(set);
|
return ImmutableSet.copyOf(set);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ResourceLocation> func_209559_a(Function<ResourceLocation, IUnbakedModel> p_209559_1_, Set<String> p_209559_2_)
|
public Collection<ResourceLocation> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextureErrors)
|
||||||
{
|
{
|
||||||
// setting parent here to make textures resolve properly
|
// setting parent here to make textures resolve properly
|
||||||
if(model.getParentLocation() != null)
|
if(model.getParentLocation() != null)
|
||||||
|
@ -471,7 +471,7 @@ public final class ModelLoader extends ModelBakery
|
||||||
{
|
{
|
||||||
return new ItemLayerModel(model).bake(modelGetter, bakedTextureGetter, perState, uvlock, format);
|
return new ItemLayerModel(model).bake(modelGetter, bakedTextureGetter, perState, uvlock, format);
|
||||||
}
|
}
|
||||||
if(model == ModelBakery.MODEL_ENTITY) return new BuiltInModel(transforms, model.func_209568_a(model, modelGetter, bakedTextureGetter));
|
if(model == ModelBakery.MODEL_ENTITY) return new BuiltInModel(transforms, model.getOverrides(model, modelGetter, bakedTextureGetter));
|
||||||
return bakeNormal(model, perState, state, newTransforms, format, modelGetter, bakedTextureGetter, uvlock);
|
return bakeNormal(model, perState, state, newTransforms, format, modelGetter, bakedTextureGetter, uvlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -479,7 +479,7 @@ public final class ModelLoader extends ModelBakery
|
||||||
{
|
{
|
||||||
final TRSRTransformation baseState = modelState.apply(Optional.empty()).orElse(TRSRTransformation.identity());
|
final TRSRTransformation baseState = modelState.apply(Optional.empty()).orElse(TRSRTransformation.identity());
|
||||||
TextureAtlasSprite particle = bakedTextureGetter.apply(new ResourceLocation(model.resolveTextureName("particle")));
|
TextureAtlasSprite particle = bakedTextureGetter.apply(new ResourceLocation(model.resolveTextureName("particle")));
|
||||||
SimpleBakedModel.Builder builder = (new SimpleBakedModel.Builder(model, model.func_209568_a(model, modelGetter, bakedTextureGetter))).setTexture(particle);
|
SimpleBakedModel.Builder builder = (new SimpleBakedModel.Builder(model, model.getOverrides(model, modelGetter, bakedTextureGetter))).setTexture(particle);
|
||||||
for(int i = 0; i < model.getElements().size(); i++)
|
for(int i = 0; i < model.getElements().size(); i++)
|
||||||
{
|
{
|
||||||
if(modelState.apply(Optional.of(Models.getHiddenModelPart(ImmutableList.of(Integer.toString(i))))).isPresent())
|
if(modelState.apply(Optional.of(Models.getHiddenModelPart(ImmutableList.of(Integer.toString(i))))).isPresent())
|
||||||
|
@ -499,7 +499,7 @@ public final class ModelLoader extends ModelBakery
|
||||||
{
|
{
|
||||||
TextureAtlasSprite textureatlassprite1 = bakedTextureGetter.apply(new ResourceLocation(model.resolveTextureName(e.getValue().texture)));
|
TextureAtlasSprite textureatlassprite1 = bakedTextureGetter.apply(new ResourceLocation(model.resolveTextureName(e.getValue().texture)));
|
||||||
|
|
||||||
if (e.getValue().cullFace == null || !TRSRTransformation.isInteger(transformation.getMatrix()))
|
if (e.getValue().cullFace == null || !TRSRTransformation.isInteger(transformation.getMatrixVec()))
|
||||||
{
|
{
|
||||||
builder.addGeneralQuad(ModelBlock.makeBakedQuad(part, e.getValue(), textureatlassprite1, e.getKey(), transformation, uvLocked));
|
builder.addGeneralQuad(ModelBlock.makeBakedQuad(part, e.getValue(), textureatlassprite1, e.getKey(), transformation, uvLocked));
|
||||||
}
|
}
|
||||||
|
@ -510,12 +510,12 @@ public final class ModelLoader extends ModelBakery
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new PerspectiveMapWrapper(builder.makeBakedModel(), perState)
|
return new PerspectiveMapWrapper(builder.build(), perState)
|
||||||
{
|
{
|
||||||
private final ItemOverrideList overrides = new AnimationItemOverrideList(VanillaModelWrapper.this, modelState, format, bakedTextureGetter, super.getOverrides());
|
private final ItemOverrideList overrides = new AnimationItemOverrideList(VanillaModelWrapper.this, modelState, format, bakedTextureGetter, super.getOverrides());
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BakedQuad> func_200117_a(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
|
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
|
||||||
{
|
{
|
||||||
if(state instanceof IExtendedBlockState)
|
if(state instanceof IExtendedBlockState)
|
||||||
{
|
{
|
||||||
|
@ -526,11 +526,11 @@ public final class ModelLoader extends ModelBakery
|
||||||
IExtendedBlockState newExState = (IExtendedBlockState) exState.withProperty(Properties.AnimationProperty, null);
|
IExtendedBlockState newExState = (IExtendedBlockState) exState.withProperty(Properties.AnimationProperty, null);
|
||||||
if(newState != null)
|
if(newState != null)
|
||||||
{
|
{
|
||||||
return VanillaModelWrapper.this.bake(modelGetter, bakedTextureGetter, new ModelStateComposition(modelState, newState), uvlock, format).func_200117_a(newExState, side, rand);
|
return VanillaModelWrapper.this.bake(modelGetter, bakedTextureGetter, new ModelStateComposition(modelState, newState), uvlock, format).getQuads(newExState, side, rand);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return super.func_200117_a(state, side, rand);
|
return super.getQuads(state, side, rand);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -675,7 +675,7 @@ public final class ModelLoader extends ModelBakery
|
||||||
ModelLoaderRegistry.getModelOrMissing(location);
|
ModelLoaderRegistry.getModelOrMissing(location);
|
||||||
}
|
}
|
||||||
//FMLLog.getLogger().error("Exception resolving indirect dependencies for model" + loc, e);
|
//FMLLog.getLogger().error("Exception resolving indirect dependencies for model" + loc, e);
|
||||||
textures.addAll(model.func_209559_a(ModelLoader.defaultModelGetter(), new HashSet<>())); // Kick this, just in case.
|
textures.addAll(model.getTextures(ModelLoader.defaultModelGetter(), new HashSet<>())); // Kick this, just in case.
|
||||||
|
|
||||||
models.add(model);
|
models.add(model);
|
||||||
|
|
||||||
|
@ -703,15 +703,15 @@ public final class ModelLoader extends ModelBakery
|
||||||
this.models = models;
|
this.models = models;
|
||||||
this.defaultState = defaultState;
|
this.defaultState = defaultState;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ResourceLocation> getOverrideLocations()
|
public Collection<ResourceLocation> getOverrideLocations()
|
||||||
{
|
{
|
||||||
return ImmutableList.copyOf(locations);
|
return ImmutableList.copyOf(locations);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ResourceLocation> func_209559_a(Function<ResourceLocation, IUnbakedModel> p_209559_1_, Set<String> p_209559_2_)
|
public Collection<ResourceLocation> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextureErrors)
|
||||||
{
|
{
|
||||||
return ImmutableSet.copyOf(textures);
|
return ImmutableSet.copyOf(textures);
|
||||||
}
|
}
|
||||||
|
@ -734,7 +734,7 @@ public final class ModelLoader extends ModelBakery
|
||||||
IUnbakedModel model = models.get(i);
|
IUnbakedModel model = models.get(i);
|
||||||
builder.add(model.bake(modelGetter, bakedTextureGetter, MultiModelState.getPartState(state, model, i), uvlock, format), variants.get(i).getWeight());
|
builder.add(model.bake(modelGetter, bakedTextureGetter, MultiModelState.getPartState(state, model, i), uvlock, format), variants.get(i).getWeight());
|
||||||
}
|
}
|
||||||
return builder.func_209614_a();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -757,7 +757,7 @@ public final class ModelLoader extends ModelBakery
|
||||||
for(int i = 0; i < this.variants.size(); i++)
|
for(int i = 0; i < this.variants.size(); i++)
|
||||||
{
|
{
|
||||||
IUnbakedModel retextured = this.models.get(i).retexture(textures);
|
IUnbakedModel retextured = this.models.get(i).retexture(textures);
|
||||||
modelTextures.addAll(retextured.func_209559_a(ModelLoader.defaultModelGetter(), new HashSet<>()));
|
modelTextures.addAll(retextured.getTextures(ModelLoader.defaultModelGetter(), new HashSet<>()));
|
||||||
retexturedModels.add(retextured);
|
retexturedModels.add(retextured);
|
||||||
builder.add(Pair.of(retextured, this.variants.get(i).getState()));
|
builder.add(Pair.of(retextured, this.variants.get(i).getState()));
|
||||||
}
|
}
|
||||||
|
@ -850,7 +850,7 @@ public final class ModelLoader extends ModelBakery
|
||||||
|
|
||||||
// NOOP, handled in loader
|
// NOOP, handled in loader
|
||||||
@Override
|
@Override
|
||||||
public void func_195410_a(IResourceManager resourceManager) {}
|
public void onResourceManagerReload(IResourceManager resourceManager) {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accepts(ResourceLocation modelLocation)
|
public boolean accepts(ResourceLocation modelLocation)
|
||||||
|
@ -887,17 +887,17 @@ public final class ModelLoader extends ModelBakery
|
||||||
return "VanillaLoader.INSTANCE";
|
return "VanillaLoader.INSTANCE";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Temporary to compile things
|
// Temporary to compile things
|
||||||
public static final class White {
|
public static final class White {
|
||||||
public static final ResourceLocation LOCATION = new ResourceLocation("white");
|
public static final ResourceLocation LOCATION = new ResourceLocation("white");
|
||||||
public static final TextureAtlasSprite INSTANCE = MissingTextureSprite.func_195677_a();
|
public static final TextureAtlasSprite INSTANCE = MissingTextureSprite.getSprite();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 16x16 pure white sprite.
|
* 16x16 pure white sprite.
|
||||||
*/
|
*/
|
||||||
/*/ TODO Custom TAS
|
/*/ TODO Custom TAS
|
||||||
public static final class White extends TextureAtlasSprite
|
public static final class White extends TextureAtlasSprite
|
||||||
{
|
{
|
||||||
public static final ResourceLocation LOCATION = new ResourceLocation("white");
|
public static final ResourceLocation LOCATION = new ResourceLocation("white");
|
||||||
|
@ -955,7 +955,7 @@ public final class ModelLoader extends ModelBakery
|
||||||
*/
|
*/
|
||||||
public void onPostBakeEvent(IRegistry<ModelResourceLocation, IBakedModel> modelRegistry)
|
public void onPostBakeEvent(IRegistry<ModelResourceLocation, IBakedModel> modelRegistry)
|
||||||
{
|
{
|
||||||
IBakedModel missingModel = modelRegistry.getObject(MODEL_MISSING);
|
IBakedModel missingModel = modelRegistry.get(MODEL_MISSING);
|
||||||
for(Map.Entry<ResourceLocation, Exception> entry : loadingExceptions.entrySet())
|
for(Map.Entry<ResourceLocation, Exception> entry : loadingExceptions.entrySet())
|
||||||
{
|
{
|
||||||
// ignoring pure ResourceLocation arguments, all things we care about pass ModelResourceLocation
|
// ignoring pure ResourceLocation arguments, all things we care about pass ModelResourceLocation
|
||||||
|
@ -963,23 +963,23 @@ public final class ModelLoader extends ModelBakery
|
||||||
{
|
{
|
||||||
LOGGER.debug(MODELLOADING, ()-> new ModelLoaderErrorMessage((ModelResourceLocation)entry.getKey(), entry.getValue()));
|
LOGGER.debug(MODELLOADING, ()-> new ModelLoaderErrorMessage((ModelResourceLocation)entry.getKey(), entry.getValue()));
|
||||||
final ModelResourceLocation location = (ModelResourceLocation)entry.getKey();
|
final ModelResourceLocation location = (ModelResourceLocation)entry.getKey();
|
||||||
final IBakedModel model = modelRegistry.getObject(location);
|
final IBakedModel model = modelRegistry.get(location);
|
||||||
if(model == null)
|
if(model == null)
|
||||||
{
|
{
|
||||||
modelRegistry.putObject(location, missingModel);
|
modelRegistry.put(location, missingModel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(ModelResourceLocation missing : missingVariants)
|
for(ModelResourceLocation missing : missingVariants)
|
||||||
{
|
{
|
||||||
IBakedModel model = modelRegistry.getObject(missing);
|
IBakedModel model = modelRegistry.get(missing);
|
||||||
if(model == null || model == missingModel)
|
if(model == null || model == missingModel)
|
||||||
{
|
{
|
||||||
LOGGER.debug(MODELLOADING, ()-> new ModelLoaderErrorMessage(missing, null));
|
LOGGER.debug(MODELLOADING, ()-> new ModelLoaderErrorMessage(missing, null));
|
||||||
}
|
}
|
||||||
if(model == null)
|
if(model == null)
|
||||||
{
|
{
|
||||||
modelRegistry.putObject(missing, missingModel);
|
modelRegistry.put(missing, missingModel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
loadingExceptions.clear();
|
loadingExceptions.clear();
|
||||||
|
@ -1047,7 +1047,7 @@ public final class ModelLoader extends ModelBakery
|
||||||
{
|
{
|
||||||
for (Entry<Pair<IRegistryDelegate<Item>, Integer>, ModelResourceLocation> e : customModels.entrySet())
|
for (Entry<Pair<IRegistryDelegate<Item>, Integer>, ModelResourceLocation> e : customModels.entrySet())
|
||||||
{
|
{
|
||||||
mesher.func_199311_a(e.getKey().getLeft().get(), e.getValue());
|
mesher.register(e.getKey().getLeft().get(), e.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
@ -1058,10 +1058,10 @@ public final class ModelLoader extends ModelBakery
|
||||||
@Override
|
@Override
|
||||||
public TextureAtlasSprite apply(ResourceLocation location)
|
public TextureAtlasSprite apply(ResourceLocation location)
|
||||||
{
|
{
|
||||||
return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(location.toString());
|
return Minecraft.getInstance().getTextureMap().getAtlasSprite(location.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Function<ResourceLocation, IUnbakedModel> DEFAULT_MODEL_GETTER = ModelLoaderRegistry::getModelOrMissing;
|
private static final Function<ResourceLocation, IUnbakedModel> DEFAULT_MODEL_GETTER = ModelLoaderRegistry::getModelOrMissing;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1071,10 +1071,10 @@ public final class ModelLoader extends ModelBakery
|
||||||
{
|
{
|
||||||
return DefaultTextureGetter.INSTANCE;
|
return DefaultTextureGetter.INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Function<ResourceLocation, IUnbakedModel> defaultModelGetter()
|
public static Function<ResourceLocation, IUnbakedModel> defaultModelGetter()
|
||||||
{
|
{
|
||||||
return DEFAULT_MODEL_GETTER;
|
return DEFAULT_MODEL_GETTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static enum VariantLoader implements ICustomModelLoader
|
protected static enum VariantLoader implements ICustomModelLoader
|
||||||
|
@ -1090,7 +1090,7 @@ public final class ModelLoader extends ModelBakery
|
||||||
|
|
||||||
// NOOP, handled in loader
|
// NOOP, handled in loader
|
||||||
@Override
|
@Override
|
||||||
public void func_195410_a(IResourceManager resourceManager) {}
|
public void onResourceManagerReload(IResourceManager resourceManager) {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accepts(ResourceLocation modelLocation)
|
public boolean accepts(ResourceLocation modelLocation)
|
||||||
|
@ -1101,7 +1101,7 @@ public final class ModelLoader extends ModelBakery
|
||||||
@Override
|
@Override
|
||||||
public IUnbakedModel loadModel(ResourceLocation modelLocation) throws Exception
|
public IUnbakedModel loadModel(ResourceLocation modelLocation) throws Exception
|
||||||
{
|
{
|
||||||
return loader.func_209597_a(modelLocation);
|
return loader.getUnbakedModel(modelLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class ModelLoaderRegistry
|
||||||
public static void registerLoader(ICustomModelLoader loader)
|
public static void registerLoader(ICustomModelLoader loader)
|
||||||
{
|
{
|
||||||
loaders.add(loader);
|
loaders.add(loader);
|
||||||
((IReloadableResourceManager) Minecraft.getMinecraft().func_195551_G()).func_199006_a(loader);
|
((IReloadableResourceManager) Minecraft.getInstance().getResourceManager()).addReloadListener(loader);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean loaded(ResourceLocation location)
|
public static boolean loaded(ResourceLocation location)
|
||||||
|
@ -174,7 +174,7 @@ public class ModelLoaderRegistry
|
||||||
{
|
{
|
||||||
throw new LoaderException(String.format("Loader %s returned null while loading model %s", accepted, location));
|
throw new LoaderException(String.format("Loader %s returned null while loading model %s", accepted, location));
|
||||||
}
|
}
|
||||||
textures.addAll(model.func_209559_a(ModelLoader.defaultModelGetter(), new HashSet<>()));
|
textures.addAll(model.getTextures(ModelLoader.defaultModelGetter(), new HashSet<>()));
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
@ -237,7 +237,7 @@ public class ModelLoaderRegistry
|
||||||
{
|
{
|
||||||
//IModel model = new FancyMissingModel(ExceptionUtils.getStackTrace(cause).replaceAll("\\t", " "));
|
//IModel model = new FancyMissingModel(ExceptionUtils.getStackTrace(cause).replaceAll("\\t", " "));
|
||||||
IUnbakedModel model = new FancyMissingModel(getMissingModel(), location.toString());
|
IUnbakedModel model = new FancyMissingModel(getMissingModel(), location.toString());
|
||||||
textures.addAll(model.func_209559_a(null, null));
|
textures.addAll(model.getTextures(null, null));
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ public final class MultiLayerModel implements IUnbakedModel
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ResourceLocation> func_209559_a(Function<ResourceLocation, IUnbakedModel> p_209559_1_, Set<String> p_209559_2_)
|
public Collection<ResourceLocation> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextureErrors)
|
||||||
{
|
{
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
@ -154,7 +154,7 @@ public final class MultiLayerModel implements IUnbakedModel
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BakedQuad> func_200117_a(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
|
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
|
||||||
{
|
{
|
||||||
BlockRenderLayer layer = MinecraftForgeClient.getRenderLayer();
|
BlockRenderLayer layer = MinecraftForgeClient.getRenderLayer();
|
||||||
if (layer == null)
|
if (layer == null)
|
||||||
|
@ -162,12 +162,12 @@ public final class MultiLayerModel implements IUnbakedModel
|
||||||
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
|
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
|
||||||
for (IBakedModel model : models.values())
|
for (IBakedModel model : models.values())
|
||||||
{
|
{
|
||||||
builder.addAll(model.func_200117_a(state, side, rand));
|
builder.addAll(model.getQuads(state, side, rand));
|
||||||
}
|
}
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
// assumes that child model will handle this state properly. FIXME?
|
// assumes that child model will handle this state properly. FIXME?
|
||||||
return models.getOrDefault(Optional.of(layer), missing).func_200117_a(state, side, rand);
|
return models.getOrDefault(Optional.of(layer), missing).getQuads(state, side, rand);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -209,7 +209,7 @@ public final class MultiLayerModel implements IUnbakedModel
|
||||||
@Override
|
@Override
|
||||||
public ItemOverrideList getOverrides()
|
public ItemOverrideList getOverrides()
|
||||||
{
|
{
|
||||||
return ItemOverrideList.NONE;
|
return ItemOverrideList.EMPTY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ public final class MultiLayerModel implements IUnbakedModel
|
||||||
INSTANCE;
|
INSTANCE;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void func_195410_a(IResourceManager resourceManager) {}
|
public void onResourceManagerReload(IResourceManager resourceManager) {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accepts(ResourceLocation modelLocation)
|
public boolean accepts(ResourceLocation modelLocation)
|
||||||
|
|
|
@ -63,7 +63,7 @@ import com.google.common.collect.Sets;
|
||||||
public final class MultiModel implements IUnbakedModel
|
public final class MultiModel implements IUnbakedModel
|
||||||
{
|
{
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogManager.getLogger();
|
||||||
|
|
||||||
private static final class Baked implements IBakedModel
|
private static final class Baked implements IBakedModel
|
||||||
{
|
{
|
||||||
private final ResourceLocation location;
|
private final ResourceLocation location;
|
||||||
|
@ -76,7 +76,7 @@ public final class MultiModel implements IUnbakedModel
|
||||||
private final ItemOverrideList overrides = new ItemOverrideList()
|
private final ItemOverrideList overrides = new ItemOverrideList()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public IBakedModel func_209581_a(IBakedModel originalModel, ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entity)
|
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entity)
|
||||||
{
|
{
|
||||||
if(originalModel != Baked.this)
|
if(originalModel != Baked.this)
|
||||||
{
|
{
|
||||||
|
@ -87,7 +87,7 @@ public final class MultiModel implements IUnbakedModel
|
||||||
|
|
||||||
if(base != null)
|
if(base != null)
|
||||||
{
|
{
|
||||||
newBase = base.getOverrides().func_209581_a(base, stack, world, entity);
|
newBase = base.getOverrides().getModelWithOverrides(base, stack, world, entity);
|
||||||
if(base != newBase)
|
if(base != newBase)
|
||||||
{
|
{
|
||||||
dirty = true;
|
dirty = true;
|
||||||
|
@ -96,7 +96,7 @@ public final class MultiModel implements IUnbakedModel
|
||||||
ImmutableMap.Builder<String, IBakedModel> builder = ImmutableMap.builder();
|
ImmutableMap.Builder<String, IBakedModel> builder = ImmutableMap.builder();
|
||||||
for(Map.Entry<String, IBakedModel> entry : parts.entrySet())
|
for(Map.Entry<String, IBakedModel> entry : parts.entrySet())
|
||||||
{
|
{
|
||||||
IBakedModel newPart = entry.getValue().getOverrides().func_209581_a(entry.getValue(), stack, world, entity);
|
IBakedModel newPart = entry.getValue().getOverrides().getModelWithOverrides(entry.getValue(), stack, world, entity);
|
||||||
builder.put(entry.getKey(), newPart);
|
builder.put(entry.getKey(), newPart);
|
||||||
if(entry.getValue() != newPart)
|
if(entry.getValue() != newPart)
|
||||||
{
|
{
|
||||||
|
@ -188,16 +188,16 @@ public final class MultiModel implements IUnbakedModel
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BakedQuad> func_200117_a(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
|
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
|
||||||
{
|
{
|
||||||
ImmutableList.Builder<BakedQuad> quads = ImmutableList.builder();
|
ImmutableList.Builder<BakedQuad> quads = ImmutableList.builder();
|
||||||
if (base != null)
|
if (base != null)
|
||||||
{
|
{
|
||||||
quads.addAll(base.func_200117_a(state, side, rand));
|
quads.addAll(base.getQuads(state, side, rand));
|
||||||
}
|
}
|
||||||
for (IBakedModel bakedPart : parts.values())
|
for (IBakedModel bakedPart : parts.values())
|
||||||
{
|
{
|
||||||
quads.addAll(bakedPart.func_200117_a(state, side, rand));
|
quads.addAll(bakedPart.getQuads(state, side, rand));
|
||||||
}
|
}
|
||||||
return quads.build();
|
return quads.build();
|
||||||
}
|
}
|
||||||
|
@ -207,7 +207,7 @@ public final class MultiModel implements IUnbakedModel
|
||||||
{
|
{
|
||||||
Pair<Baked, TRSRTransformation> p = transforms.get(cameraTransformType);
|
Pair<Baked, TRSRTransformation> p = transforms.get(cameraTransformType);
|
||||||
if (p == null) return Pair.of(this, null);
|
if (p == null) return Pair.of(this, null);
|
||||||
return Pair.of(p.getLeft(), p.getRight().getMatrix());
|
return Pair.of(p.getLeft(), p.getRight().getMatrixVec());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -247,9 +247,9 @@ public final class MultiModel implements IUnbakedModel
|
||||||
{
|
{
|
||||||
this(location, base, ImmutableMap.copyOf(parts));
|
this(location, base, ImmutableMap.copyOf(parts));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ResourceLocation> getOverrideLocations()
|
public Collection<ResourceLocation> getOverrideLocations()
|
||||||
{
|
{
|
||||||
Set<ResourceLocation> deps = Sets.newHashSet();
|
Set<ResourceLocation> deps = Sets.newHashSet();
|
||||||
|
|
||||||
|
@ -261,17 +261,17 @@ public final class MultiModel implements IUnbakedModel
|
||||||
|
|
||||||
return deps;
|
return deps;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ResourceLocation> func_209559_a(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextures)
|
public Collection<ResourceLocation> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextures)
|
||||||
{
|
{
|
||||||
Set<ResourceLocation> deps = Sets.newHashSet();
|
Set<ResourceLocation> deps = Sets.newHashSet();
|
||||||
|
|
||||||
if (base != null)
|
if (base != null)
|
||||||
deps.addAll(base.func_209559_a(modelGetter, missingTextures));
|
deps.addAll(base.getTextures(modelGetter, missingTextures));
|
||||||
|
|
||||||
for (Pair<IUnbakedModel, IModelState> pair : parts.values())
|
for (Pair<IUnbakedModel, IModelState> pair : parts.values())
|
||||||
deps.addAll(pair.getLeft().func_209559_a(modelGetter, missingTextures));
|
deps.addAll(pair.getLeft().getTextures(modelGetter, missingTextures));
|
||||||
|
|
||||||
return deps;
|
return deps;
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class PerspectiveMapWrapper implements IBakedModel
|
||||||
TRSRTransformation tr = transforms.getOrDefault(cameraTransformType, TRSRTransformation.identity());
|
TRSRTransformation tr = transforms.getOrDefault(cameraTransformType, TRSRTransformation.identity());
|
||||||
if (!tr.isIdentity())
|
if (!tr.isIdentity())
|
||||||
{
|
{
|
||||||
return Pair.of(model, TRSRTransformation.blockCornerToCenter(tr).getMatrix());
|
return Pair.of(model, TRSRTransformation.blockCornerToCenter(tr).getMatrixVec());
|
||||||
}
|
}
|
||||||
return Pair.of(model, null);
|
return Pair.of(model, null);
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ public class PerspectiveMapWrapper implements IBakedModel
|
||||||
TRSRTransformation tr = state.apply(Optional.of(cameraTransformType)).orElse(TRSRTransformation.identity());
|
TRSRTransformation tr = state.apply(Optional.of(cameraTransformType)).orElse(TRSRTransformation.identity());
|
||||||
if (!tr.isIdentity())
|
if (!tr.isIdentity())
|
||||||
{
|
{
|
||||||
return Pair.of(model, TRSRTransformation.blockCornerToCenter(tr).getMatrix());
|
return Pair.of(model, TRSRTransformation.blockCornerToCenter(tr).getMatrixVec());
|
||||||
}
|
}
|
||||||
return Pair.of(model, null);
|
return Pair.of(model, null);
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ public class PerspectiveMapWrapper implements IBakedModel
|
||||||
@Override public TextureAtlasSprite getParticleTexture() { return parent.getParticleTexture(); }
|
@Override public TextureAtlasSprite getParticleTexture() { return parent.getParticleTexture(); }
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@Override public ItemCameraTransforms getItemCameraTransforms() { return parent.getItemCameraTransforms(); }
|
@Override public ItemCameraTransforms getItemCameraTransforms() { return parent.getItemCameraTransforms(); }
|
||||||
@Override public List<BakedQuad> func_200117_a(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand) { return parent.func_200117_a(state, side, rand); }
|
@Override public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand) { return parent.getQuads(state, side, rand); }
|
||||||
@Override public ItemOverrideList getOverrides() { return parent.getOverrides(); }
|
@Override public ItemOverrideList getOverrides() { return parent.getOverrides(); }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -47,10 +47,10 @@ public enum Animation
|
||||||
{
|
{
|
||||||
if (worldRef == null || worldRef.get() != world)
|
if (worldRef == null || worldRef.get() != world)
|
||||||
{
|
{
|
||||||
epochTime = world.getTotalWorldTime();
|
epochTime = world.getGameTime();
|
||||||
worldRef = new WeakReference<>(world);
|
worldRef = new WeakReference<>(world);
|
||||||
}
|
}
|
||||||
return (world.getTotalWorldTime() - epochTime + tickProgress) / 20;
|
return (world.getGameTime() - epochTime + tickProgress) / 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -65,7 +65,7 @@ public final class AnimationItemOverrideList extends ItemOverrideList
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBakedModel func_209581_a(IBakedModel originalModel, ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entity)
|
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, @Nullable World world, @Nullable EntityLivingBase entity)
|
||||||
{
|
{
|
||||||
return stack.getCapability(CapabilityAnimation.ANIMATION_CAPABILITY, null)
|
return stack.getCapability(CapabilityAnimation.ANIMATION_CAPABILITY, null)
|
||||||
.map(asm ->
|
.map(asm ->
|
||||||
|
@ -78,12 +78,12 @@ public final class AnimationItemOverrideList extends ItemOverrideList
|
||||||
}
|
}
|
||||||
if(world == null)
|
if(world == null)
|
||||||
{
|
{
|
||||||
w = Minecraft.getMinecraft().world;
|
w = Minecraft.getInstance().world;
|
||||||
}
|
}
|
||||||
return asm.apply(Animation.getWorldTime(world, Animation.getPartialTickTime())).getLeft();
|
return asm.apply(Animation.getWorldTime(world, Animation.getPartialTickTime())).getLeft();
|
||||||
})
|
})
|
||||||
// TODO where should uvlock data come from?
|
// TODO where should uvlock data come from?
|
||||||
.map(state -> model.bake(ModelLoader.defaultModelGetter(), bakedTextureGetter, new ModelStateComposition(state, this.state), false, format))
|
.map(state -> model.bake(ModelLoader.defaultModelGetter(), bakedTextureGetter, new ModelStateComposition(state, this.state), false, format))
|
||||||
.orElseGet(() -> super.func_209581_a(originalModel, stack, world, entity));
|
.orElseGet(() -> super.getModelWithOverrides(originalModel, stack, world, entity));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ public class AnimationModelBase<T extends Entity> extends ModelBase implements I
|
||||||
|
|
||||||
RenderHelper.disableStandardItemLighting();
|
RenderHelper.disableStandardItemLighting();
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
GlStateManager.rotate(180, 0, 0, 1);
|
GlStateManager.rotatef(180, 0, 0, 1);
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
BufferBuilder builder = tessellator.getBuffer();
|
BufferBuilder builder = tessellator.getBuffer();
|
||||||
builder.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
|
builder.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
|
||||||
|
@ -95,7 +95,7 @@ public class AnimationModelBase<T extends Entity> extends ModelBase implements I
|
||||||
boolean empty = true;
|
boolean empty = true;
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
random.setSeed(42);
|
random.setSeed(42);
|
||||||
List<BakedQuad> quads = bakedModel.func_200117_a(null, null, random);
|
List<BakedQuad> quads = bakedModel.getQuads(null, null, random);
|
||||||
if(!quads.isEmpty())
|
if(!quads.isEmpty())
|
||||||
{
|
{
|
||||||
lighter.updateBlockInfo();
|
lighter.updateBlockInfo();
|
||||||
|
@ -108,7 +108,7 @@ public class AnimationModelBase<T extends Entity> extends ModelBase implements I
|
||||||
for(EnumFacing side : EnumFacing.values())
|
for(EnumFacing side : EnumFacing.values())
|
||||||
{
|
{
|
||||||
random.setSeed(42);
|
random.setSeed(42);
|
||||||
quads = bakedModel.func_200117_a(null, side, random);
|
quads = bakedModel.getQuads(null, side, random);
|
||||||
if(!quads.isEmpty())
|
if(!quads.isEmpty())
|
||||||
{
|
{
|
||||||
if(empty) lighter.updateBlockInfo();
|
if(empty) lighter.updateBlockInfo();
|
||||||
|
|
|
@ -56,13 +56,13 @@ public class AnimationTESR<T extends TileEntity> extends FastTESR<T> implements
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(blockRenderer == null) blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher();
|
if(blockRenderer == null) blockRenderer = Minecraft.getInstance().getBlockRendererDispatcher();
|
||||||
BlockPos pos = te.getPos();
|
BlockPos pos = te.getPos();
|
||||||
IWorldReader world = MinecraftForgeClient.getRegionRenderCache(te.getWorld(), pos);
|
IWorldReader world = MinecraftForgeClient.getRegionRenderCache(te.getWorld(), pos);
|
||||||
IBlockState state = world.getBlockState(pos);
|
IBlockState state = world.getBlockState(pos);
|
||||||
if(state.getBlock().getBlockState().getProperties().contains(Properties.StaticProperty))
|
if(state.getBlock().getStateContainer().getProperties().contains(Properties.StaticProperty))
|
||||||
{
|
{
|
||||||
state = state.func_206870_a(Properties.StaticProperty, false);
|
state = state.with(Properties.StaticProperty, false);
|
||||||
}
|
}
|
||||||
if(state instanceof IExtendedBlockState)
|
if(state instanceof IExtendedBlockState)
|
||||||
{
|
{
|
||||||
|
@ -76,12 +76,12 @@ public class AnimationTESR<T extends TileEntity> extends FastTESR<T> implements
|
||||||
handleEvents(te, time, pair.getRight());
|
handleEvents(te, time, pair.getRight());
|
||||||
|
|
||||||
// TODO: caching?
|
// TODO: caching?
|
||||||
IBakedModel model = blockRenderer.getBlockModelShapes().getModelForState(exState.getClean());
|
IBakedModel model = blockRenderer.getBlockModelShapes().getModel(exState.getClean());
|
||||||
IExtendedBlockState animState = (IExtendedBlockState) exState.withProperty(Properties.AnimationProperty, pair.getLeft());
|
IExtendedBlockState animState = (IExtendedBlockState) exState.withProperty(Properties.AnimationProperty, pair.getLeft());
|
||||||
|
|
||||||
renderer.setTranslation(x - pos.getX(), y - pos.getY(), z - pos.getZ());
|
renderer.setTranslation(x - pos.getX(), y - pos.getY(), z - pos.getZ());
|
||||||
|
|
||||||
blockRenderer.getBlockModelRenderer().func_199324_a(world, model, animState, pos, renderer, false, new Random(), 42);
|
blockRenderer.getBlockModelRenderer().renderModel(world, model, animState, pos, renderer, false, new Random(), 42);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
public abstract class FastTESR<T extends TileEntity> extends TileEntityRenderer<T>
|
public abstract class FastTESR<T extends TileEntity> extends TileEntityRenderer<T>
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public final void func_199341_a(T te, double x, double y, double z, float partialTicks, int destroyStage)
|
public final void render(T te, double x, double y, double z, float partialTicks, int destroyStage)
|
||||||
{
|
{
|
||||||
Tessellator tessellator = Tessellator.getInstance();
|
Tessellator tessellator = Tessellator.getInstance();
|
||||||
BufferBuilder buffer = tessellator.getBuffer();
|
BufferBuilder buffer = tessellator.getBuffer();
|
||||||
|
|
|
@ -71,8 +71,8 @@ import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
public class ModelBlockAnimation
|
public class ModelBlockAnimation
|
||||||
{
|
{
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogManager.getLogger();
|
||||||
|
|
||||||
private final ImmutableMap<String, ImmutableMap<String, float[]>> joints;
|
private final ImmutableMap<String, ImmutableMap<String, float[]>> joints;
|
||||||
private final ImmutableMap<String, MBClip> clips;
|
private final ImmutableMap<String, MBClip> clips;
|
||||||
private transient ImmutableMultimap<Integer, MBJointWeight> jointIndexMap;
|
private transient ImmutableMultimap<Integer, MBJointWeight> jointIndexMap;
|
||||||
|
@ -534,7 +534,7 @@ public class ModelBlockAnimation
|
||||||
if(trOp.isPresent() && !trOp.get().isIdentity())
|
if(trOp.isPresent() && !trOp.get().isIdentity())
|
||||||
{
|
{
|
||||||
float w = info.getWeights().get(i)[0];
|
float w = info.getWeights().get(i)[0];
|
||||||
tmp = trOp.get().getMatrix();
|
tmp = trOp.get().getMatrixVec();
|
||||||
tmp.mul(w);
|
tmp.mul(w);
|
||||||
m.add(tmp);
|
m.add(tmp);
|
||||||
weight += w;
|
weight += w;
|
||||||
|
@ -557,9 +557,9 @@ public class ModelBlockAnimation
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
try (IResource resource = manager.func_199002_a(armatureLocation))
|
try (IResource resource = manager.getResource(armatureLocation))
|
||||||
{
|
{
|
||||||
ModelBlockAnimation mba = mbaGson.fromJson(new InputStreamReader(resource.func_199027_b(), StandardCharsets.UTF_8), ModelBlockAnimation.class);
|
ModelBlockAnimation mba = mbaGson.fromJson(new InputStreamReader(resource.getInputStream(), StandardCharsets.UTF_8), ModelBlockAnimation.class);
|
||||||
//String json = mbaGson.toJson(mba);
|
//String json = mbaGson.toJson(mba);
|
||||||
return mba;
|
return mba;
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,8 +98,8 @@ import com.google.gson.JsonParser;
|
||||||
public enum B3DLoader implements ICustomModelLoader
|
public enum B3DLoader implements ICustomModelLoader
|
||||||
{
|
{
|
||||||
INSTANCE;
|
INSTANCE;
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogManager.getLogger();
|
||||||
|
|
||||||
private IResourceManager manager;
|
private IResourceManager manager;
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ public enum B3DLoader implements ICustomModelLoader
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void func_195410_a(IResourceManager manager)
|
public void onResourceManagerReload(IResourceManager manager)
|
||||||
{
|
{
|
||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
cache.clear();
|
cache.clear();
|
||||||
|
@ -136,17 +136,17 @@ public enum B3DLoader implements ICustomModelLoader
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
resource = manager.func_199002_a(file);
|
resource = manager.getResource(file);
|
||||||
}
|
}
|
||||||
catch(FileNotFoundException e)
|
catch(FileNotFoundException e)
|
||||||
{
|
{
|
||||||
if(modelLocation.getPath().startsWith("models/block/"))
|
if(modelLocation.getPath().startsWith("models/block/"))
|
||||||
resource = manager.func_199002_a(new ResourceLocation(file.getNamespace(), "models/item/" + file.getPath().substring("models/block/".length())));
|
resource = manager.getResource(new ResourceLocation(file.getNamespace(), "models/item/" + file.getPath().substring("models/block/".length())));
|
||||||
else if(modelLocation.getPath().startsWith("models/item/"))
|
else if(modelLocation.getPath().startsWith("models/item/"))
|
||||||
resource = manager.func_199002_a(new ResourceLocation(file.getNamespace(), "models/block/" + file.getPath().substring("models/item/".length())));
|
resource = manager.getResource(new ResourceLocation(file.getNamespace(), "models/block/" + file.getPath().substring("models/item/".length())));
|
||||||
else throw e;
|
else throw e;
|
||||||
}
|
}
|
||||||
B3DModel.Parser parser = new B3DModel.Parser(resource.func_199027_b());
|
B3DModel.Parser parser = new B3DModel.Parser(resource.getInputStream());
|
||||||
B3DModel model = parser.parse();
|
B3DModel model = parser.parse();
|
||||||
cache.put(file, model);
|
cache.put(file, model);
|
||||||
}
|
}
|
||||||
|
@ -365,7 +365,7 @@ public enum B3DLoader implements ICustomModelLoader
|
||||||
@Override
|
@Override
|
||||||
public TRSRTransformation getInvBindPose()
|
public TRSRTransformation getInvBindPose()
|
||||||
{
|
{
|
||||||
Matrix4f m = new TRSRTransformation(node.getPos(), node.getRot(), node.getScale(), null).getMatrix();
|
Matrix4f m = new TRSRTransformation(node.getPos(), node.getRot(), node.getScale(), null).getMatrixVec();
|
||||||
m.invert();
|
m.invert();
|
||||||
TRSRTransformation pose = new TRSRTransformation(m);
|
TRSRTransformation pose = new TRSRTransformation(m);
|
||||||
|
|
||||||
|
@ -452,17 +452,17 @@ public enum B3DLoader implements ICustomModelLoader
|
||||||
if(path.endsWith(".png")) path = path.substring(0, path.length() - ".png".length());
|
if(path.endsWith(".png")) path = path.substring(0, path.length() - ".png".length());
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ResourceLocation> func_209559_a(Function<ResourceLocation, IUnbakedModel> p_209559_1_, Set<String> p_209559_2_)
|
public Collection<ResourceLocation> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextureErrors)
|
||||||
{
|
{
|
||||||
return Collections2.filter(textures.values(), loc -> !loc.getPath().startsWith("#"));
|
return Collections2.filter(textures.values(), loc -> !loc.getPath().startsWith("#"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ResourceLocation> getOverrideLocations()
|
public Collection<ResourceLocation> getOverrideLocations()
|
||||||
{
|
{
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -647,7 +647,7 @@ public enum B3DLoader implements ICustomModelLoader
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BakedQuad> func_200117_a(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
|
public List<BakedQuad> getQuads(@Nullable IBlockState state, @Nullable EnumFacing side, Random rand)
|
||||||
{
|
{
|
||||||
if(side != null) return ImmutableList.of();
|
if(side != null) return ImmutableList.of();
|
||||||
IModelState modelState = this.state;
|
IModelState modelState = this.state;
|
||||||
|
@ -723,7 +723,7 @@ public enum B3DLoader implements ICustomModelLoader
|
||||||
@Override
|
@Override
|
||||||
public Matrix4f apply(Node<?> node)
|
public Matrix4f apply(Node<?> node)
|
||||||
{
|
{
|
||||||
return global.compose(localCache.getUnchecked(node)).getMatrix();
|
return global.compose(localCache.getUnchecked(node)).getMatrixVec();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
for(Face f : faces)
|
for(Face f : faces)
|
||||||
|
@ -834,7 +834,7 @@ public enum B3DLoader implements ICustomModelLoader
|
||||||
public ItemOverrideList getOverrides()
|
public ItemOverrideList getOverrides()
|
||||||
{
|
{
|
||||||
// TODO handle items
|
// TODO handle items
|
||||||
return ItemOverrideList.NONE;
|
return ItemOverrideList.EMPTY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ public enum OBJLoader implements ICustomModelLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void func_195410_a(IResourceManager resourceManager)
|
public void onResourceManagerReload(IResourceManager resourceManager)
|
||||||
{
|
{
|
||||||
this.manager = resourceManager;
|
this.manager = resourceManager;
|
||||||
cache.clear();
|
cache.clear();
|
||||||
|
@ -82,14 +82,14 @@ public enum OBJLoader implements ICustomModelLoader {
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
resource = manager.func_199002_a(file);
|
resource = manager.getResource(file);
|
||||||
}
|
}
|
||||||
catch (FileNotFoundException e)
|
catch (FileNotFoundException e)
|
||||||
{
|
{
|
||||||
if (modelLocation.getPath().startsWith("models/block/"))
|
if (modelLocation.getPath().startsWith("models/block/"))
|
||||||
resource = manager.func_199002_a(new ResourceLocation(file.getNamespace(), "models/item/" + file.getPath().substring("models/block/".length())));
|
resource = manager.getResource(new ResourceLocation(file.getNamespace(), "models/item/" + file.getPath().substring("models/block/".length())));
|
||||||
else if (modelLocation.getPath().startsWith("models/item/"))
|
else if (modelLocation.getPath().startsWith("models/item/"))
|
||||||
resource = manager.func_199002_a(new ResourceLocation(file.getNamespace(), "models/block/" + file.getPath().substring("models/item/".length())));
|
resource = manager.getResource(new ResourceLocation(file.getNamespace(), "models/block/" + file.getPath().substring("models/item/".length())));
|
||||||
else throw e;
|
else throw e;
|
||||||
}
|
}
|
||||||
OBJModel.Parser parser = new OBJModel.Parser(resource, manager);
|
OBJModel.Parser parser = new OBJModel.Parser(resource, manager);
|
||||||
|
|
|
@ -83,8 +83,8 @@ import com.google.common.collect.Maps;
|
||||||
|
|
||||||
public class OBJModel implements IUnbakedModel
|
public class OBJModel implements IUnbakedModel
|
||||||
{
|
{
|
||||||
private static final Logger LOGGER = LogManager.getLogger();
|
private static final Logger LOGGER = LogManager.getLogger();
|
||||||
|
|
||||||
//private Gson GSON = new GsonBuilder().create();
|
//private Gson GSON = new GsonBuilder().create();
|
||||||
private MaterialLibrary matLib;
|
private MaterialLibrary matLib;
|
||||||
private final ResourceLocation modelLocation;
|
private final ResourceLocation modelLocation;
|
||||||
|
@ -103,7 +103,7 @@ public class OBJModel implements IUnbakedModel
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ResourceLocation> func_209559_a(Function<ResourceLocation, IUnbakedModel> p_209559_1_, Set<String> p_209559_2_)
|
public Collection<ResourceLocation> getTextures(Function<ResourceLocation, IUnbakedModel> modelGetter, Set<String> missingTextureErrors)
|
||||||
{
|
{
|
||||||
Iterator<Material> materialIterator = this.matLib.materials.values().iterator();
|
Iterator<Material> materialIterator = this.matLib.materials.values().iterator();
|
||||||
List<ResourceLocation> textures = Lists.newArrayList();
|
List<ResourceLocation> textures = Lists.newArrayList();
|
||||||
|
@ -116,11 +116,11 @@ public class OBJModel implements IUnbakedModel
|
||||||
}
|
}
|
||||||
return textures;
|
return textures;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ResourceLocation> getOverrideLocations()
|
public Collection<ResourceLocation> getOverrideLocations()
|
||||||
{
|
{
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -216,8 +216,8 @@ public class OBJModel implements IUnbakedModel
|
||||||
public Parser(IResource from, IResourceManager manager) throws IOException
|
public Parser(IResource from, IResourceManager manager) throws IOException
|
||||||
{
|
{
|
||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
this.objFrom = from.func_199029_a();
|
this.objFrom = from.getLocation();
|
||||||
this.objStream = new InputStreamReader(from.func_199027_b(), StandardCharsets.UTF_8);
|
this.objStream = new InputStreamReader(from.getInputStream(), StandardCharsets.UTF_8);
|
||||||
this.objReader = new BufferedReader(objStream);
|
this.objReader = new BufferedReader(objStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -517,7 +517,7 @@ public class OBJModel implements IUnbakedModel
|
||||||
String domain = from.getNamespace();
|
String domain = from.getNamespace();
|
||||||
if (!path.contains("/"))
|
if (!path.contains("/"))
|
||||||
path = from.getPath().substring(0, from.getPath().lastIndexOf("/") + 1) + path;
|
path = from.getPath().substring(0, from.getPath().lastIndexOf("/") + 1) + path;
|
||||||
mtlStream = new InputStreamReader(manager.func_199002_a(new ResourceLocation(domain, path)).func_199027_b(), StandardCharsets.UTF_8);
|
mtlStream = new InputStreamReader(manager.getResource(new ResourceLocation(domain, path)).getInputStream(), StandardCharsets.UTF_8);
|
||||||
mtlReader = new BufferedReader(mtlStream);
|
mtlReader = new BufferedReader(mtlStream);
|
||||||
|
|
||||||
String currentLine = "";
|
String currentLine = "";
|
||||||
|
@ -857,7 +857,7 @@ public class OBJModel implements IUnbakedModel
|
||||||
|
|
||||||
public Face bake(TRSRTransformation transform)
|
public Face bake(TRSRTransformation transform)
|
||||||
{
|
{
|
||||||
Matrix4f m = transform.getMatrix();
|
Matrix4f m = transform.getMatrixVec();
|
||||||
Matrix3f mn = null;
|
Matrix3f mn = null;
|
||||||
Vertex[] vertices = new Vertex[verts.length];
|
Vertex[] vertices = new Vertex[verts.length];
|
||||||
// Normal[] normals = norms != null ? new Normal[norms.length] : null;
|
// Normal[] normals = norms != null ? new Normal[norms.length] : null;
|
||||||
|
@ -1318,7 +1318,7 @@ public class OBJModel implements IUnbakedModel
|
||||||
|
|
||||||
// FIXME: merge with getQuads
|
// FIXME: merge with getQuads
|
||||||
@Override
|
@Override
|
||||||
public List<BakedQuad> func_200117_a(IBlockState blockState, EnumFacing side, Random rand)
|
public List<BakedQuad> getQuads(IBlockState blockState, EnumFacing side, Random rand)
|
||||||
{
|
{
|
||||||
if (side != null) return ImmutableList.of();
|
if (side != null) return ImmutableList.of();
|
||||||
if (quads == null)
|
if (quads == null)
|
||||||
|
@ -1598,7 +1598,7 @@ public class OBJModel implements IUnbakedModel
|
||||||
@Override
|
@Override
|
||||||
public ItemOverrideList getOverrides()
|
public ItemOverrideList getOverrides()
|
||||||
{
|
{
|
||||||
return ItemOverrideList.NONE;
|
return ItemOverrideList.EMPTY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class BlockInfo
|
||||||
{
|
{
|
||||||
if(cachedTint == tint) return cachedMultiplier;
|
if(cachedTint == tint) return cachedMultiplier;
|
||||||
cachedTint = tint;
|
cachedTint = tint;
|
||||||
cachedMultiplier = colors.colorMultiplier(state, world, blockPos, tint);
|
cachedMultiplier = colors.getColor(state, world, blockPos, tint);
|
||||||
return cachedMultiplier;
|
return cachedMultiplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class ForgeBlockModelRenderer extends BlockModelRenderer
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean func_199325_c(IWorldReader world, IBakedModel model, IBlockState state, BlockPos pos, BufferBuilder buffer, boolean checkSides, Random rand, long seed)
|
public boolean renderModelFlat(IWorldReader world, IBakedModel model, IBlockState state, BlockPos pos, BufferBuilder buffer, boolean checkSides, Random rand, long seed)
|
||||||
{
|
{
|
||||||
if(ForgeMod.forgeLightPipelineEnabled)
|
if(ForgeMod.forgeLightPipelineEnabled)
|
||||||
{
|
{
|
||||||
|
@ -68,12 +68,12 @@ public class ForgeBlockModelRenderer extends BlockModelRenderer
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return super.func_199325_c(world, model, state, pos, buffer, checkSides, rand, seed);
|
return super.renderModelFlat(world, model, state, pos, buffer, checkSides, rand, seed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean func_199326_b(IWorldReader world, IBakedModel model, IBlockState state, BlockPos pos, BufferBuilder buffer, boolean checkSides, Random rand, long seed)
|
public boolean renderModelSmooth(IWorldReader world, IBakedModel model, IBlockState state, BlockPos pos, BufferBuilder buffer, boolean checkSides, Random rand, long seed)
|
||||||
{
|
{
|
||||||
if(ForgeMod.forgeLightPipelineEnabled)
|
if(ForgeMod.forgeLightPipelineEnabled)
|
||||||
{
|
{
|
||||||
|
@ -89,7 +89,7 @@ public class ForgeBlockModelRenderer extends BlockModelRenderer
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return super.func_199326_b(world, model, state, pos, buffer, checkSides, rand, seed);
|
return super.renderModelSmooth(world, model, state, pos, buffer, checkSides, rand, seed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ public class ForgeBlockModelRenderer extends BlockModelRenderer
|
||||||
lighter.setState(state);
|
lighter.setState(state);
|
||||||
lighter.setBlockPos(pos);
|
lighter.setBlockPos(pos);
|
||||||
boolean empty = true;
|
boolean empty = true;
|
||||||
List<BakedQuad> quads = model.func_200117_a(state, null, rand);
|
List<BakedQuad> quads = model.getQuads(state, null, rand);
|
||||||
if(!quads.isEmpty())
|
if(!quads.isEmpty())
|
||||||
{
|
{
|
||||||
lighter.updateBlockInfo();
|
lighter.updateBlockInfo();
|
||||||
|
@ -111,7 +111,7 @@ public class ForgeBlockModelRenderer extends BlockModelRenderer
|
||||||
}
|
}
|
||||||
for(EnumFacing side : EnumFacing.values())
|
for(EnumFacing side : EnumFacing.values())
|
||||||
{
|
{
|
||||||
quads = model.func_200117_a(state, side, rand);
|
quads = model.getQuads(state, side, rand);
|
||||||
if(!quads.isEmpty())
|
if(!quads.isEmpty())
|
||||||
{
|
{
|
||||||
if(!checkSides || Block.shouldSideBeRendered(state, world, pos, side))
|
if(!checkSides || Block.shouldSideBeRendered(state, world, pos, side))
|
||||||
|
|
|
@ -43,4 +43,4 @@ public abstract class TransformerConsumer implements IVertexConsumer {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract float[] transform(int element, float... data);
|
protected abstract float[] transform(int element, float... data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -180,8 +180,8 @@ public class UnpackedBakedQuad extends BakedQuad
|
||||||
}
|
}
|
||||||
if(contractUVs)
|
if(contractUVs)
|
||||||
{
|
{
|
||||||
float tX = texture.getIconWidth() / (texture.getMaxU() - texture.getMinU());
|
float tX = texture.getWidth() / (texture.getMaxU() - texture.getMinU());
|
||||||
float tY = texture.getIconHeight() / (texture.getMaxV() - texture.getMinV());
|
float tY = texture.getHeight() / (texture.getMaxV() - texture.getMinV());
|
||||||
float tS = tX > tY ? tX : tY;
|
float tS = tX > tY ? tX : tY;
|
||||||
float ep = 1f / (tS * 0x100);
|
float ep = 1f / (tS * 0x100);
|
||||||
int uve = 0;
|
int uve = 0;
|
||||||
|
@ -235,4 +235,4 @@ public class UnpackedBakedQuad extends BakedQuad
|
||||||
return new UnpackedBakedQuad(unpackedData, tint, orientation, texture, applyDiffuseLighting, format);
|
return new UnpackedBakedQuad(unpackedData, tint, orientation, texture, applyDiffuseLighting, format);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,7 @@ public class VertexLighterFlat extends QuadGatheringTransformer
|
||||||
|
|
||||||
private static VertexFormat withNormal(VertexFormat format)
|
private static VertexFormat withNormal(VertexFormat format)
|
||||||
{
|
{
|
||||||
if (format == null || format.func_207751_b()) return format;
|
if (format == null || format.hasNormal()) return format;
|
||||||
return new VertexFormat(format).addElement(NORMAL_4F);
|
return new VertexFormat(format).addElement(NORMAL_4F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ import net.minecraft.resources.IResourceManagerReloadListener;
|
||||||
public interface ISelectiveResourceReloadListener extends IResourceManagerReloadListener
|
public interface ISelectiveResourceReloadListener extends IResourceManagerReloadListener
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
default void func_195410_a(IResourceManager resourceManager)
|
default void onResourceManagerReload(IResourceManager resourceManager)
|
||||||
{
|
{
|
||||||
// For compatibility, call the selective version from the non-selective function
|
// For compatibility, call the selective version from the non-selective function
|
||||||
onResourceManagerReload(resourceManager, SelectiveReloadStateHandler.INSTANCE.get());
|
onResourceManagerReload(resourceManager, SelectiveReloadStateHandler.INSTANCE.get());
|
||||||
|
|
|
@ -49,7 +49,7 @@ public enum KeyConflictContext implements IKeyConflictContext
|
||||||
@Override
|
@Override
|
||||||
public boolean isActive()
|
public boolean isActive()
|
||||||
{
|
{
|
||||||
return Minecraft.getMinecraft().currentScreen != null;
|
return Minecraft.getInstance().currentScreen != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -33,7 +33,7 @@ public enum KeyModifier {
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(InputMappings.Input key)
|
public boolean matches(InputMappings.Input key)
|
||||||
{
|
{
|
||||||
int keyCode = key.func_197937_c();
|
int keyCode = key.getKeyCode();
|
||||||
if (Minecraft.IS_RUNNING_ON_MAC)
|
if (Minecraft.IS_RUNNING_ON_MAC)
|
||||||
{
|
{
|
||||||
return keyCode == GLFW.GLFW_KEY_LEFT_ALT || keyCode == GLFW.GLFW_KEY_RIGHT_ALT;
|
return keyCode == GLFW.GLFW_KEY_LEFT_ALT || keyCode == GLFW.GLFW_KEY_RIGHT_ALT;
|
||||||
|
@ -59,7 +59,7 @@ public enum KeyModifier {
|
||||||
@Override
|
@Override
|
||||||
public String getLocalizedComboName(InputMappings.Input key)
|
public String getLocalizedComboName(InputMappings.Input key)
|
||||||
{
|
{
|
||||||
String keyName = key.func_197936_a();
|
String keyName = key.getName();
|
||||||
String localizationFormatKey = Minecraft.IS_RUNNING_ON_MAC ? "forge.controlsgui.control.mac" : "forge.controlsgui.control";
|
String localizationFormatKey = Minecraft.IS_RUNNING_ON_MAC ? "forge.controlsgui.control.mac" : "forge.controlsgui.control";
|
||||||
return I18n.format(localizationFormatKey, keyName);
|
return I18n.format(localizationFormatKey, keyName);
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ public enum KeyModifier {
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(InputMappings.Input key)
|
public boolean matches(InputMappings.Input key)
|
||||||
{
|
{
|
||||||
return key.func_197937_c() == GLFW.GLFW_KEY_LEFT_SHIFT || key.func_197937_c() == GLFW.GLFW_KEY_RIGHT_SHIFT;
|
return key.getKeyCode() == GLFW.GLFW_KEY_LEFT_SHIFT || key.getKeyCode() == GLFW.GLFW_KEY_RIGHT_SHIFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -86,14 +86,14 @@ public enum KeyModifier {
|
||||||
@Override
|
@Override
|
||||||
public String getLocalizedComboName(InputMappings.Input key)
|
public String getLocalizedComboName(InputMappings.Input key)
|
||||||
{
|
{
|
||||||
return I18n.format("forge.controlsgui.shift", key.func_197936_a());
|
return I18n.format("forge.controlsgui.shift", key.getName());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ALT {
|
ALT {
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(InputMappings.Input key)
|
public boolean matches(InputMappings.Input key)
|
||||||
{
|
{
|
||||||
return key.func_197937_c() == GLFW.GLFW_KEY_LEFT_ALT || key.func_197937_c() == GLFW.GLFW_KEY_RIGHT_ALT;
|
return key.getKeyCode() == GLFW.GLFW_KEY_LEFT_ALT || key.getKeyCode() == GLFW.GLFW_KEY_RIGHT_ALT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -111,7 +111,7 @@ public enum KeyModifier {
|
||||||
@Override
|
@Override
|
||||||
public String getLocalizedComboName(InputMappings.Input keyCode)
|
public String getLocalizedComboName(InputMappings.Input keyCode)
|
||||||
{
|
{
|
||||||
return I18n.format("forge.controlsgui.alt", keyCode.func_197936_a());
|
return I18n.format("forge.controlsgui.alt", keyCode.getName());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
NONE {
|
NONE {
|
||||||
|
@ -146,7 +146,7 @@ public enum KeyModifier {
|
||||||
@Override
|
@Override
|
||||||
public String getLocalizedComboName(InputMappings.Input key)
|
public String getLocalizedComboName(InputMappings.Input key)
|
||||||
{
|
{
|
||||||
return key.func_197936_a();
|
return key.getName();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -270,18 +270,18 @@ public class BiomeDictionary
|
||||||
*/
|
*/
|
||||||
public static void makeBestGuess(Biome biome)
|
public static void makeBestGuess(Biome biome)
|
||||||
{
|
{
|
||||||
Type type = Type.fromVanilla(biome.func_201856_r());
|
Type type = Type.fromVanilla(biome.getCategory());
|
||||||
if (type != null)
|
if (type != null)
|
||||||
{
|
{
|
||||||
BiomeDictionary.addTypes(biome, type);
|
BiomeDictionary.addTypes(biome, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (biome.getRainfall() > 0.85f)
|
if (biome.getDownfall() > 0.85f)
|
||||||
{
|
{
|
||||||
BiomeDictionary.addTypes(biome, WET);
|
BiomeDictionary.addTypes(biome, WET);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (biome.getRainfall() < 0.15f)
|
if (biome.getDownfall() < 0.15f)
|
||||||
{
|
{
|
||||||
BiomeDictionary.addTypes(biome, DRY);
|
BiomeDictionary.addTypes(biome, DRY);
|
||||||
}
|
}
|
||||||
|
@ -296,14 +296,14 @@ public class BiomeDictionary
|
||||||
BiomeDictionary.addTypes(biome, COLD);
|
BiomeDictionary.addTypes(biome, COLD);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (biome.isHighHumidity() && biome.getBaseHeight() < 0.0F && (biome.getHeightVariation() <= 0.3F && biome.getHeightVariation() >= 0.0F))
|
if (biome.isHighHumidity() && biome.getDepth() < 0.0F && (biome.getScale() <= 0.3F && biome.getScale() >= 0.0F))
|
||||||
{
|
{
|
||||||
BiomeDictionary.addTypes(biome, SWAMP);
|
BiomeDictionary.addTypes(biome, SWAMP);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (biome.getBaseHeight() <= -0.5F)
|
if (biome.getDepth() <= -0.5F)
|
||||||
{
|
{
|
||||||
if (biome.getHeightVariation() == 0.0F)
|
if (biome.getScale() == 0.0F)
|
||||||
{
|
{
|
||||||
BiomeDictionary.addTypes(biome, RIVER);
|
BiomeDictionary.addTypes(biome, RIVER);
|
||||||
}
|
}
|
||||||
|
@ -313,12 +313,12 @@ public class BiomeDictionary
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (biome.getHeightVariation() >= 0.4F && biome.getHeightVariation() < 1.5F)
|
if (biome.getScale() >= 0.4F && biome.getScale() < 1.5F)
|
||||||
{
|
{
|
||||||
BiomeDictionary.addTypes(biome, HILLS);
|
BiomeDictionary.addTypes(biome, HILLS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (biome.getHeightVariation() >= 1.5F)
|
if (biome.getScale() >= 1.5F)
|
||||||
{
|
{
|
||||||
BiomeDictionary.addTypes(biome, MOUNTAIN);
|
BiomeDictionary.addTypes(biome, MOUNTAIN);
|
||||||
}
|
}
|
||||||
|
@ -367,76 +367,76 @@ public class BiomeDictionary
|
||||||
addTypes(Biomes.OCEAN, OCEAN );
|
addTypes(Biomes.OCEAN, OCEAN );
|
||||||
addTypes(Biomes.PLAINS, PLAINS );
|
addTypes(Biomes.PLAINS, PLAINS );
|
||||||
addTypes(Biomes.DESERT, HOT, DRY, SANDY );
|
addTypes(Biomes.DESERT, HOT, DRY, SANDY );
|
||||||
addTypes(Biomes.EXTREME_HILLS, MOUNTAIN, HILLS );
|
addTypes(Biomes.MOUNTAINS, MOUNTAIN, HILLS );
|
||||||
addTypes(Biomes.FOREST, FOREST );
|
addTypes(Biomes.FOREST, FOREST );
|
||||||
addTypes(Biomes.TAIGA, COLD, CONIFEROUS, FOREST );
|
addTypes(Biomes.TAIGA, COLD, CONIFEROUS, FOREST );
|
||||||
addTypes(Biomes.SWAMPLAND, WET, SWAMP );
|
addTypes(Biomes.SWAMP, WET, SWAMP );
|
||||||
addTypes(Biomes.RIVER, RIVER );
|
addTypes(Biomes.RIVER, RIVER );
|
||||||
addTypes(Biomes.HELL, HOT, DRY, NETHER );
|
addTypes(Biomes.NETHER, HOT, DRY, NETHER );
|
||||||
addTypes(Biomes.SKY, COLD, DRY, END );
|
addTypes(Biomes.THE_END, COLD, DRY, END );
|
||||||
addTypes(Biomes.FROZEN_OCEAN, COLD, OCEAN, SNOWY );
|
addTypes(Biomes.FROZEN_OCEAN, COLD, OCEAN, SNOWY );
|
||||||
addTypes(Biomes.FROZEN_RIVER, COLD, RIVER, SNOWY );
|
addTypes(Biomes.FROZEN_RIVER, COLD, RIVER, SNOWY );
|
||||||
addTypes(Biomes.ICE_PLAINS, COLD, SNOWY, WASTELAND );
|
addTypes(Biomes.SNOWY_TUNDRA, COLD, SNOWY, WASTELAND );
|
||||||
addTypes(Biomes.ICE_MOUNTAINS, COLD, SNOWY, MOUNTAIN );
|
addTypes(Biomes.SNOWY_MOUNTAINS, COLD, SNOWY, MOUNTAIN );
|
||||||
addTypes(Biomes.MUSHROOM_ISLAND, MUSHROOM, RARE );
|
addTypes(Biomes.MUSHROOM_FIELDS, MUSHROOM, RARE );
|
||||||
addTypes(Biomes.MUSHROOM_ISLAND_SHORE, MUSHROOM, BEACH, RARE );
|
addTypes(Biomes.MUSHROOM_FIELD_SHORE, MUSHROOM, BEACH, RARE );
|
||||||
addTypes(Biomes.BEACH, BEACH );
|
addTypes(Biomes.BEACH, BEACH );
|
||||||
addTypes(Biomes.DESERT_HILLS, HOT, DRY, SANDY, HILLS );
|
addTypes(Biomes.DESERT_HILLS, HOT, DRY, SANDY, HILLS );
|
||||||
addTypes(Biomes.FOREST_HILLS, FOREST, HILLS );
|
addTypes(Biomes.WOODED_HILLS, FOREST, HILLS );
|
||||||
addTypes(Biomes.TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS );
|
addTypes(Biomes.TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS );
|
||||||
addTypes(Biomes.EXTREME_HILLS_EDGE, MOUNTAIN );
|
addTypes(Biomes.MOUNTAIN_EDGE, MOUNTAIN );
|
||||||
addTypes(Biomes.JUNGLE, HOT, WET, DENSE, JUNGLE );
|
addTypes(Biomes.JUNGLE, HOT, WET, DENSE, JUNGLE );
|
||||||
addTypes(Biomes.JUNGLE_HILLS, HOT, WET, DENSE, JUNGLE, HILLS );
|
addTypes(Biomes.JUNGLE_HILLS, HOT, WET, DENSE, JUNGLE, HILLS );
|
||||||
addTypes(Biomes.JUNGLE_EDGE, HOT, WET, JUNGLE, FOREST, RARE );
|
addTypes(Biomes.JUNGLE_EDGE, HOT, WET, JUNGLE, FOREST, RARE );
|
||||||
addTypes(Biomes.DEEP_OCEAN, OCEAN );
|
addTypes(Biomes.DEEP_OCEAN, OCEAN );
|
||||||
addTypes(Biomes.STONE_BEACH, BEACH );
|
addTypes(Biomes.STONE_SHORE, BEACH );
|
||||||
addTypes(Biomes.COLD_BEACH, COLD, BEACH, SNOWY );
|
addTypes(Biomes.SNOWY_BEACH, COLD, BEACH, SNOWY );
|
||||||
addTypes(Biomes.BIRCH_FOREST, FOREST );
|
addTypes(Biomes.BIRCH_FOREST, FOREST );
|
||||||
addTypes(Biomes.BIRCH_FOREST_HILLS, FOREST, HILLS );
|
addTypes(Biomes.BIRCH_FOREST_HILLS, FOREST, HILLS );
|
||||||
addTypes(Biomes.ROOFED_FOREST, SPOOKY, DENSE, FOREST );
|
addTypes(Biomes.DARK_FOREST, SPOOKY, DENSE, FOREST );
|
||||||
addTypes(Biomes.COLD_TAIGA, COLD, CONIFEROUS, FOREST, SNOWY );
|
addTypes(Biomes.SNOWY_TAIGA, COLD, CONIFEROUS, FOREST, SNOWY );
|
||||||
addTypes(Biomes.COLD_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, SNOWY, HILLS );
|
addTypes(Biomes.SNOWY_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, SNOWY, HILLS );
|
||||||
addTypes(Biomes.REDWOOD_TAIGA, COLD, CONIFEROUS, FOREST );
|
addTypes(Biomes.GIANT_TREE_TAIGA, COLD, CONIFEROUS, FOREST );
|
||||||
addTypes(Biomes.REDWOOD_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS );
|
addTypes(Biomes.GIANT_TREE_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS );
|
||||||
addTypes(Biomes.EXTREME_HILLS_WITH_TREES, MOUNTAIN, FOREST, SPARSE );
|
addTypes(Biomes.WOODED_MOUNTAINS, MOUNTAIN, FOREST, SPARSE );
|
||||||
addTypes(Biomes.SAVANNA, HOT, SAVANNA, PLAINS, SPARSE );
|
addTypes(Biomes.SAVANNA, HOT, SAVANNA, PLAINS, SPARSE );
|
||||||
addTypes(Biomes.SAVANNA_PLATEAU, HOT, SAVANNA, PLAINS, SPARSE, RARE );
|
addTypes(Biomes.SAVANNA_PLATEAU, HOT, SAVANNA, PLAINS, SPARSE, RARE );
|
||||||
addTypes(Biomes.MESA, MESA, SANDY );
|
addTypes(Biomes.BADLANDS, MESA, SANDY );
|
||||||
addTypes(Biomes.MESA_ROCK, MESA, SPARSE, SANDY );
|
addTypes(Biomes.WOODED_BADLANDS_PLATEAU, MESA, SPARSE, SANDY );
|
||||||
addTypes(Biomes.MESA_CLEAR_ROCK, MESA, SANDY );
|
addTypes(Biomes.BADLANDS_PLATEAU, MESA, SANDY );
|
||||||
addTypes(Biomes.field_201936_P, END );
|
addTypes(Biomes.SMALL_END_ISLANDS, END );
|
||||||
addTypes(Biomes.field_201937_Q, END );
|
addTypes(Biomes.END_MIDLANDS, END );
|
||||||
addTypes(Biomes.field_201938_R, END );
|
addTypes(Biomes.END_HIGHLANDS, END );
|
||||||
addTypes(Biomes.field_201939_S, END );
|
addTypes(Biomes.END_BARRENS, END );
|
||||||
addTypes(Biomes.field_203614_T, OCEAN, HOT );
|
addTypes(Biomes.WARM_OCEAN, OCEAN, HOT );
|
||||||
addTypes(Biomes.field_203615_U, OCEAN );
|
addTypes(Biomes.LUKEWARM_OCEAN, OCEAN );
|
||||||
addTypes(Biomes.field_203616_V, OCEAN, COLD );
|
addTypes(Biomes.COLD_OCEAN, OCEAN, COLD );
|
||||||
addTypes(Biomes.field_203617_W, OCEAN, HOT );
|
addTypes(Biomes.DEEP_WARM_OCEAN, OCEAN, HOT );
|
||||||
addTypes(Biomes.field_203618_X, OCEAN );
|
addTypes(Biomes.DEEP_LUKEWARM_OCEAN, OCEAN );
|
||||||
addTypes(Biomes.field_203619_Y, OCEAN, COLD );
|
addTypes(Biomes.DEEP_COLD_OCEAN, OCEAN, COLD );
|
||||||
addTypes(Biomes.field_203620_Z, OCEAN, COLD );
|
addTypes(Biomes.DEEP_FROZEN_OCEAN, OCEAN, COLD );
|
||||||
addTypes(Biomes.VOID, VOID );
|
addTypes(Biomes.THE_VOID, VOID );
|
||||||
addTypes(Biomes.MUTATED_PLAINS, PLAINS, RARE );
|
addTypes(Biomes.SUNFLOWER_PLAINS, PLAINS, RARE );
|
||||||
addTypes(Biomes.MUTATED_DESERT, HOT, DRY, SANDY, RARE );
|
addTypes(Biomes.DESERT_LAKES, HOT, DRY, SANDY, RARE );
|
||||||
addTypes(Biomes.MUTATED_EXTREME_HILLS, MOUNTAIN, SPARSE, RARE );
|
addTypes(Biomes.GRAVELLY_MOUNTAINS, MOUNTAIN, SPARSE, RARE );
|
||||||
addTypes(Biomes.MUTATED_FOREST, FOREST, HILLS, RARE );
|
addTypes(Biomes.FLOWER_FOREST, FOREST, HILLS, RARE );
|
||||||
addTypes(Biomes.MUTATED_TAIGA, COLD, CONIFEROUS, FOREST, MOUNTAIN, RARE );
|
addTypes(Biomes.TAIGA_MOUNTAINS, COLD, CONIFEROUS, FOREST, MOUNTAIN, RARE );
|
||||||
addTypes(Biomes.MUTATED_SWAMPLAND, WET, SWAMP, HILLS, RARE );
|
addTypes(Biomes.SWAMP_HILLS, WET, SWAMP, HILLS, RARE );
|
||||||
addTypes(Biomes.MUTATED_ICE_FLATS, COLD, SNOWY, HILLS, RARE );
|
addTypes(Biomes.ICE_SPIKES, COLD, SNOWY, HILLS, RARE );
|
||||||
addTypes(Biomes.MUTATED_JUNGLE, HOT, WET, DENSE, JUNGLE, MOUNTAIN, RARE);
|
addTypes(Biomes.MODIFIED_JUNGLE, HOT, WET, DENSE, JUNGLE, MOUNTAIN, RARE);
|
||||||
addTypes(Biomes.MUTATED_JUNGLE_EDGE, HOT, SPARSE, JUNGLE, HILLS, RARE );
|
addTypes(Biomes.MODIFIED_JUNGLE_EDGE, HOT, SPARSE, JUNGLE, HILLS, RARE );
|
||||||
addTypes(Biomes.MUTATED_BIRCH_FOREST, FOREST, DENSE, HILLS, RARE );
|
addTypes(Biomes.TALL_BIRCH_FOREST, FOREST, DENSE, HILLS, RARE );
|
||||||
addTypes(Biomes.MUTATED_BIRCH_FOREST_HILLS, FOREST, DENSE, MOUNTAIN, RARE );
|
addTypes(Biomes.TALL_BIRCH_HILLS, FOREST, DENSE, MOUNTAIN, RARE );
|
||||||
addTypes(Biomes.MUTATED_ROOFED_FOREST, SPOOKY, DENSE, FOREST, MOUNTAIN, RARE );
|
addTypes(Biomes.DARK_FOREST_HILLS, SPOOKY, DENSE, FOREST, MOUNTAIN, RARE );
|
||||||
addTypes(Biomes.MUTATED_TAIGA_COLD, COLD, CONIFEROUS, FOREST, SNOWY, MOUNTAIN, RARE);
|
addTypes(Biomes.SNOWY_TAIGA_MOUNTAINS, COLD, CONIFEROUS, FOREST, SNOWY, MOUNTAIN, RARE);
|
||||||
addTypes(Biomes.MUTATED_REDWOOD_TAIGA, DENSE, FOREST, RARE );
|
addTypes(Biomes.GIANT_SPRUCE_TAIGA, DENSE, FOREST, RARE );
|
||||||
addTypes(Biomes.MUTATED_REDWOOD_TAIGA_HILLS, DENSE, FOREST, HILLS, RARE );
|
addTypes(Biomes.GIANT_SPRUCE_TAIGA_HILLS, DENSE, FOREST, HILLS, RARE );
|
||||||
addTypes(Biomes.MUTATED_EXTREME_HILLS_WITH_TREES, MOUNTAIN, SPARSE, RARE );
|
addTypes(Biomes.MODIFIED_GRAVELLY_MOUNTAINS, MOUNTAIN, SPARSE, RARE );
|
||||||
addTypes(Biomes.MUTATED_SAVANNA, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
|
addTypes(Biomes.SHATTERED_SAVANNA, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
|
||||||
addTypes(Biomes.MUTATED_SAVANNA_ROCK, HOT, DRY, SPARSE, SAVANNA, HILLS, RARE);
|
addTypes(Biomes.SHATTERED_SAVANNA_PLATEAU, HOT, DRY, SPARSE, SAVANNA, HILLS, RARE);
|
||||||
addTypes(Biomes.MUTATED_MESA, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
|
addTypes(Biomes.ERODED_BADLANDS, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
|
||||||
addTypes(Biomes.MUTATED_MESA_ROCK, HOT, DRY, SPARSE, HILLS, RARE );
|
addTypes(Biomes.MODIFIED_WOODED_BADLANDS_PLATEAU, HOT, DRY, SPARSE, HILLS, RARE );
|
||||||
addTypes(Biomes.MUTATED_MESA_CLEAR_ROCK, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
|
addTypes(Biomes.MODIFIED_BADLANDS_PLATEAU, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
|
||||||
|
|
||||||
|
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
|
|
|
@ -52,25 +52,25 @@ public class BiomeManager
|
||||||
List<BiomeEntry> list = new ArrayList<BiomeEntry>();
|
List<BiomeEntry> list = new ArrayList<BiomeEntry>();
|
||||||
|
|
||||||
list.add(new BiomeEntry(Biomes.FOREST, 10));
|
list.add(new BiomeEntry(Biomes.FOREST, 10));
|
||||||
list.add(new BiomeEntry(Biomes.ROOFED_FOREST, 10));
|
list.add(new BiomeEntry(Biomes.DARK_FOREST, 10));
|
||||||
list.add(new BiomeEntry(Biomes.EXTREME_HILLS, 10));
|
list.add(new BiomeEntry(Biomes.MOUNTAINS, 10));
|
||||||
list.add(new BiomeEntry(Biomes.PLAINS, 10));
|
list.add(new BiomeEntry(Biomes.PLAINS, 10));
|
||||||
list.add(new BiomeEntry(Biomes.BIRCH_FOREST, 10));
|
list.add(new BiomeEntry(Biomes.BIRCH_FOREST, 10));
|
||||||
list.add(new BiomeEntry(Biomes.SWAMPLAND, 10));
|
list.add(new BiomeEntry(Biomes.SWAMP, 10));
|
||||||
|
|
||||||
currentBiomes[BiomeType.WARM.ordinal()] = new TrackedList<BiomeEntry>(list);
|
currentBiomes[BiomeType.WARM.ordinal()] = new TrackedList<BiomeEntry>(list);
|
||||||
list.clear();
|
list.clear();
|
||||||
|
|
||||||
list.add(new BiomeEntry(Biomes.FOREST, 10));
|
list.add(new BiomeEntry(Biomes.FOREST, 10));
|
||||||
list.add(new BiomeEntry(Biomes.EXTREME_HILLS, 10));
|
list.add(new BiomeEntry(Biomes.MOUNTAINS, 10));
|
||||||
list.add(new BiomeEntry(Biomes.TAIGA, 10));
|
list.add(new BiomeEntry(Biomes.TAIGA, 10));
|
||||||
list.add(new BiomeEntry(Biomes.PLAINS, 10));
|
list.add(new BiomeEntry(Biomes.PLAINS, 10));
|
||||||
|
|
||||||
currentBiomes[BiomeType.COOL.ordinal()] = new TrackedList<BiomeEntry>(list);
|
currentBiomes[BiomeType.COOL.ordinal()] = new TrackedList<BiomeEntry>(list);
|
||||||
list.clear();
|
list.clear();
|
||||||
|
|
||||||
list.add(new BiomeEntry(Biomes.ICE_PLAINS, 30));
|
list.add(new BiomeEntry(Biomes.SNOWY_TUNDRA, 30));
|
||||||
list.add(new BiomeEntry(Biomes.COLD_TAIGA, 10));
|
list.add(new BiomeEntry(Biomes.SNOWY_TAIGA, 10));
|
||||||
|
|
||||||
currentBiomes[BiomeType.ICY.ordinal()] = new TrackedList<BiomeEntry>(list);
|
currentBiomes[BiomeType.ICY.ordinal()] = new TrackedList<BiomeEntry>(list);
|
||||||
list.clear();
|
list.clear();
|
||||||
|
@ -82,17 +82,17 @@ public class BiomeManager
|
||||||
|
|
||||||
public static void addSpawnBiome(Biome biome)
|
public static void addSpawnBiome(Biome biome)
|
||||||
{
|
{
|
||||||
if (!BiomeProvider.field_201540_a.contains(biome))
|
if (!BiomeProvider.BIOMES_TO_SPAWN_IN.contains(biome))
|
||||||
{
|
{
|
||||||
BiomeProvider.field_201540_a.add(biome);
|
BiomeProvider.BIOMES_TO_SPAWN_IN.add(biome);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void removeSpawnBiome(Biome biome)
|
public static void removeSpawnBiome(Biome biome)
|
||||||
{
|
{
|
||||||
if (BiomeProvider.field_201540_a.contains(biome))
|
if (BiomeProvider.BIOMES_TO_SPAWN_IN.contains(biome))
|
||||||
{
|
{
|
||||||
BiomeProvider.field_201540_a.remove(biome);
|
BiomeProvider.BIOMES_TO_SPAWN_IN.remove(biome);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -173,7 +173,7 @@ public class DimensionManager
|
||||||
|
|
||||||
public static Dimension getProvider(int dim)
|
public static Dimension getProvider(int dim)
|
||||||
{
|
{
|
||||||
return getWorld(dim).provider;
|
return getWorld(dim).dimension;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Integer[] getIDs(boolean check)
|
public static Integer[] getIDs(boolean check)
|
||||||
|
@ -219,7 +219,7 @@ public class DimensionManager
|
||||||
{
|
{
|
||||||
worlds.put(id, world);
|
worlds.put(id, world);
|
||||||
weakWorldMap.put(world, world);
|
weakWorldMap.put(world, world);
|
||||||
LOGGER.info(DIMMGR,"Loading dimension {} ({}) ({})", id, world.getWorldInfo().getWorldName(), world.getMinecraftServer());
|
LOGGER.info(DIMMGR,"Loading dimension {} ({}) ({})", id, world.getWorldInfo().getWorldName(), world.getServer());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -264,7 +264,7 @@ public class DimensionManager
|
||||||
LOGGER.error(DIMMGR,"Cannot Hotload Dim: {}", dim, e);
|
LOGGER.error(DIMMGR,"Cannot Hotload Dim: {}", dim, e);
|
||||||
return; // If a provider hasn't been registered then we can't hotload the dim
|
return; // If a provider hasn't been registered then we can't hotload the dim
|
||||||
}
|
}
|
||||||
MinecraftServer mcServer = overworld.getMinecraftServer();
|
MinecraftServer mcServer = overworld.getServer();
|
||||||
ISaveHandler savehandler = overworld.getSaveHandler();
|
ISaveHandler savehandler = overworld.getSaveHandler();
|
||||||
//WorldSettings worldSettings = new WorldSettings(overworld.getWorldInfo());
|
//WorldSettings worldSettings = new WorldSettings(overworld.getWorldInfo());
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ public class DimensionManager
|
||||||
{
|
{
|
||||||
if (dimensions.containsKey(dim))
|
if (dimensions.containsKey(dim))
|
||||||
{
|
{
|
||||||
Dimension ret = getProviderType(dim).createDimension();
|
Dimension ret = getProviderType(dim).create();
|
||||||
ret.setId(dim);
|
ret.setId(dim);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -361,8 +361,8 @@ public class DimensionManager
|
||||||
{
|
{
|
||||||
return ForgeChunkManager.getPersistentChunksFor(world).isEmpty()
|
return ForgeChunkManager.getPersistentChunksFor(world).isEmpty()
|
||||||
&& world.playerEntities.isEmpty()
|
&& world.playerEntities.isEmpty()
|
||||||
&& !world.provider.getDimensionType().shouldLoadSpawn()
|
&& !world.dimension.getType().shouldLoadSpawn()
|
||||||
&& !keepLoaded.contains(world.provider.getId());
|
&& !keepLoaded.contains(world.dimension.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -421,7 +421,7 @@ public class DimensionManager
|
||||||
{
|
{
|
||||||
MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(w));
|
MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(w));
|
||||||
w.close();
|
w.close();
|
||||||
setWorld(id, null, w.getMinecraftServer());
|
setWorld(id, null, w.getServer());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -456,7 +456,7 @@ public class ForgeChunkManager
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
NBTTagCompound forcedChunkData = CompressedStreamTools.read(chunkLoaderData);
|
NBTTagCompound forcedChunkData = CompressedStreamTools.read(chunkLoaderData);
|
||||||
return forcedChunkData.getTagList("TicketList", Constants.NBT.TAG_COMPOUND).size() > 0;
|
return forcedChunkData.getList("TicketList", Constants.NBT.TAG_COMPOUND).size() > 0;
|
||||||
}
|
}
|
||||||
catch (IOException e)
|
catch (IOException e)
|
||||||
{
|
{
|
||||||
|
@ -499,10 +499,10 @@ public class ForgeChunkManager
|
||||||
LOGGER.warn(CHUNK_MANAGER, "Unable to read forced chunk data at {} - it will be ignored", chunkLoaderData.getAbsolutePath(), e);
|
LOGGER.warn(CHUNK_MANAGER, "Unable to read forced chunk data at {} - it will be ignored", chunkLoaderData.getAbsolutePath(), e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
NBTTagList ticketList = forcedChunkData.getTagList("TicketList", Constants.NBT.TAG_COMPOUND);
|
NBTTagList ticketList = forcedChunkData.getList("TicketList", Constants.NBT.TAG_COMPOUND);
|
||||||
for (int i = 0; i < ticketList.size(); i++)
|
for (int i = 0; i < ticketList.size(); i++)
|
||||||
{
|
{
|
||||||
NBTTagCompound ticketHolder = ticketList.getCompoundTagAt(i);
|
NBTTagCompound ticketHolder = ticketList.getCompound(i);
|
||||||
String modId = ticketHolder.getString("Owner");
|
String modId = ticketHolder.getString("Owner");
|
||||||
boolean isPlayer = ForgeVersion.MOD_ID.equals(modId);
|
boolean isPlayer = ForgeVersion.MOD_ID.equals(modId);
|
||||||
|
|
||||||
|
@ -518,17 +518,17 @@ public class ForgeChunkManager
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
NBTTagList tickets = ticketHolder.getTagList("Tickets", Constants.NBT.TAG_COMPOUND);
|
NBTTagList tickets = ticketHolder.getList("Tickets", Constants.NBT.TAG_COMPOUND);
|
||||||
for (int j = 0; j < tickets.size(); j++)
|
for (int j = 0; j < tickets.size(); j++)
|
||||||
{
|
{
|
||||||
NBTTagCompound ticket = tickets.getCompoundTagAt(j);
|
NBTTagCompound ticket = tickets.getCompound(j);
|
||||||
modId = ticket.hasKey("ModId") ? ticket.getString("ModId") : modId;
|
modId = ticket.hasKey("ModId") ? ticket.getString("ModId") : modId;
|
||||||
Type type = Type.values()[ticket.getByte("Type")];
|
Type type = Type.values()[ticket.getByte("Type")];
|
||||||
//byte ticketChunkDepth = ticket.getByte("ChunkListDepth");
|
//byte ticketChunkDepth = ticket.getByte("ChunkListDepth");
|
||||||
Ticket tick = new Ticket(modId, type, world);
|
Ticket tick = new Ticket(modId, type, world);
|
||||||
if (ticket.hasKey("ModData"))
|
if (ticket.hasKey("ModData"))
|
||||||
{
|
{
|
||||||
tick.modData = ticket.getCompoundTag("ModData");
|
tick.modData = ticket.getCompound("ModData");
|
||||||
}
|
}
|
||||||
if (ticket.hasKey("Player"))
|
if (ticket.hasKey("Player"))
|
||||||
{
|
{
|
||||||
|
@ -545,8 +545,8 @@ public class ForgeChunkManager
|
||||||
}
|
}
|
||||||
if (type == Type.ENTITY)
|
if (type == Type.ENTITY)
|
||||||
{
|
{
|
||||||
tick.entityChunkX = ticket.getInteger("chunkX");
|
tick.entityChunkX = ticket.getInt("chunkX");
|
||||||
tick.entityChunkZ = ticket.getInteger("chunkZ");
|
tick.entityChunkZ = ticket.getInt("chunkZ");
|
||||||
UUID uuid = new UUID(ticket.getLong("PersistentIDMSB"), ticket.getLong("PersistentIDLSB"));
|
UUID uuid = new UUID(ticket.getLong("PersistentIDMSB"), ticket.getLong("PersistentIDLSB"));
|
||||||
// add the ticket to the "pending entity" list
|
// add the ticket to the "pending entity" list
|
||||||
pendingEntities.put(uuid, tick);
|
pendingEntities.put(uuid, tick);
|
||||||
|
@ -936,10 +936,10 @@ public class ForgeChunkManager
|
||||||
{
|
{
|
||||||
ticket.setTag("ModData", tick.modData);
|
ticket.setTag("ModData", tick.modData);
|
||||||
}
|
}
|
||||||
if (tick.ticketType == Type.ENTITY && tick.entity != null && tick.entity.writeToNBTOptional(new NBTTagCompound()))
|
if (tick.ticketType == Type.ENTITY && tick.entity != null && tick.entity.writeUnlessPassenger(new NBTTagCompound()))
|
||||||
{
|
{
|
||||||
ticket.setInteger("chunkX", MathHelper.floor(tick.entity.chunkCoordX));
|
ticket.setInt("chunkX", MathHelper.floor(tick.entity.chunkCoordX));
|
||||||
ticket.setInteger("chunkZ", MathHelper.floor(tick.entity.chunkCoordZ));
|
ticket.setInt("chunkZ", MathHelper.floor(tick.entity.chunkCoordZ));
|
||||||
ticket.setLong("PersistentIDMSB", tick.entity.getUniqueID().getMostSignificantBits());
|
ticket.setLong("PersistentIDMSB", tick.entity.getUniqueID().getMostSignificantBits());
|
||||||
ticket.setLong("PersistentIDLSB", tick.entity.getUniqueID().getLeastSignificantBits());
|
ticket.setLong("PersistentIDLSB", tick.entity.getUniqueID().getLeastSignificantBits());
|
||||||
tickets.add(ticket);
|
tickets.add(ticket);
|
||||||
|
@ -996,8 +996,8 @@ public class ForgeChunkManager
|
||||||
ChunkEntry entry = cache.getIfPresent(ChunkPos.asLong(chunk.x, chunk.z));
|
ChunkEntry entry = cache.getIfPresent(ChunkPos.asLong(chunk.x, chunk.z));
|
||||||
if (entry != null)
|
if (entry != null)
|
||||||
{
|
{
|
||||||
entry.nbt.setTag("Entities", nbt.getTagList("Entities", Constants.NBT.TAG_COMPOUND));
|
entry.nbt.setTag("Entities", nbt.getList("Entities", Constants.NBT.TAG_COMPOUND));
|
||||||
entry.nbt.setTag("TileEntities", nbt.getTagList("TileEntities", Constants.NBT.TAG_COMPOUND));
|
entry.nbt.setTag("TileEntities", nbt.getList("TileEntities", Constants.NBT.TAG_COMPOUND));
|
||||||
|
|
||||||
ClassInheritanceMultiMap<Entity>[] entityLists = chunk.getEntityLists();
|
ClassInheritanceMultiMap<Entity>[] entityLists = chunk.getEntityLists();
|
||||||
for (int i = 0; i < entityLists.length; ++i)
|
for (int i = 0; i < entityLists.length; ++i)
|
||||||
|
@ -1027,17 +1027,17 @@ public class ForgeChunkManager
|
||||||
|
|
||||||
private static void loadChunkEntities(Chunk chunk, NBTTagCompound nbt, World world)
|
private static void loadChunkEntities(Chunk chunk, NBTTagCompound nbt, World world)
|
||||||
{
|
{
|
||||||
NBTTagList entities = nbt.getTagList("Entities", Constants.NBT.TAG_COMPOUND);
|
NBTTagList entities = nbt.getList("Entities", Constants.NBT.TAG_COMPOUND);
|
||||||
for (int i = 0; i < entities.size(); ++i)
|
for (int i = 0; i < entities.size(); ++i)
|
||||||
{
|
{
|
||||||
AnvilChunkLoader.readChunkEntity(entities.getCompoundTagAt(i), world, chunk);
|
AnvilChunkLoader.readChunkEntity(entities.getCompound(i), world, chunk);
|
||||||
chunk.setHasEntities(true);
|
chunk.setHasEntities(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
NBTTagList tileEntities = nbt.getTagList("TileEntities", Constants.NBT.TAG_COMPOUND);
|
NBTTagList tileEntities = nbt.getList("TileEntities", Constants.NBT.TAG_COMPOUND);
|
||||||
for (int i = 0; i < tileEntities.size(); ++i)
|
for (int i = 0; i < tileEntities.size(); ++i)
|
||||||
{
|
{
|
||||||
TileEntity tileEntity = TileEntity.func_203403_c(tileEntities.getCompoundTagAt(i));
|
TileEntity tileEntity = TileEntity.create(tileEntities.getCompound(i));
|
||||||
if (tileEntity != null) chunk.addTileEntity(tileEntity);
|
if (tileEntity != null) chunk.addTileEntity(tileEntity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -456,10 +456,10 @@ public class ForgeHooks
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
ItemStack result;
|
ItemStack result;
|
||||||
boolean isCreative = player.capabilities.isCreativeMode;
|
boolean isCreative = player.abilities.isCreativeMode;
|
||||||
TileEntity te = null;
|
TileEntity te = null;
|
||||||
|
|
||||||
if (target.typeOfHit == RayTraceResult.Type.BLOCK)
|
if (target.type == RayTraceResult.Type.BLOCK)
|
||||||
{
|
{
|
||||||
IBlockState state = world.getBlockState(target.getBlockPos());
|
IBlockState state = world.getBlockState(target.getBlockPos());
|
||||||
|
|
||||||
|
@ -475,12 +475,12 @@ public class ForgeHooks
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (target.typeOfHit != RayTraceResult.Type.ENTITY || target.entityHit == null || !isCreative)
|
if (target.type != RayTraceResult.Type.ENTITY || target.entity == null || !isCreative)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = target.entityHit.getPickedResult(target);
|
result = target.entity.getPickedResult(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result.isEmpty())
|
if (result.isEmpty())
|
||||||
|
@ -490,13 +490,13 @@ public class ForgeHooks
|
||||||
|
|
||||||
if (te != null)
|
if (te != null)
|
||||||
{
|
{
|
||||||
Minecraft.getMinecraft().storeTEInStack(result, te);
|
Minecraft.getInstance().storeTEInStack(result, te);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isCreative)
|
if (isCreative)
|
||||||
{
|
{
|
||||||
player.inventory.setPickedItemStack(result);
|
player.inventory.setPickedItemStack(result);
|
||||||
Minecraft.getMinecraft().playerController.sendSlotPacket(player.getHeldItem(EnumHand.MAIN_HAND), 36 + player.inventory.currentItem);
|
Minecraft.getInstance().playerController.sendSlotPacket(player.getHeldItem(EnumHand.MAIN_HAND), 36 + player.inventory.currentItem);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
int slot = player.inventory.getSlotFor(result);
|
int slot = player.inventory.getSlotFor(result);
|
||||||
|
@ -505,7 +505,7 @@ public class ForgeHooks
|
||||||
if (InventoryPlayer.isHotbar(slot))
|
if (InventoryPlayer.isHotbar(slot))
|
||||||
player.inventory.currentItem = slot;
|
player.inventory.currentItem = slot;
|
||||||
else
|
else
|
||||||
Minecraft.getMinecraft().playerController.pickItem(slot);
|
Minecraft.getInstance().playerController.pickItem(slot);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -610,7 +610,7 @@ public class ForgeHooks
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AxisAlignedBB bb = entity.getEntityBoundingBox();
|
AxisAlignedBB bb = entity.getBoundingBox();
|
||||||
int mX = MathHelper.floor(bb.minX);
|
int mX = MathHelper.floor(bb.minX);
|
||||||
int mY = MathHelper.floor(bb.minY);
|
int mY = MathHelper.floor(bb.minY);
|
||||||
int mZ = MathHelper.floor(bb.minZ);
|
int mZ = MathHelper.floor(bb.minZ);
|
||||||
|
@ -769,7 +769,7 @@ public class ForgeHooks
|
||||||
|
|
||||||
if (!entityPlayer.isAllowEdit())
|
if (!entityPlayer.isAllowEdit())
|
||||||
{
|
{
|
||||||
if (itemstack.isEmpty() || !itemstack.func_206848_a(world.func_205772_D(), new BlockWorldState(world, pos, false)))
|
if (itemstack.isEmpty() || !itemstack.canDestroy(world.getTags(), new BlockWorldState(world, pos, false)))
|
||||||
preCancelEvent = true;
|
preCancelEvent = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -809,8 +809,8 @@ public class ForgeHooks
|
||||||
/* TODO: Talk to Sponge folk about World rollbacks.
|
/* TODO: Talk to Sponge folk about World rollbacks.
|
||||||
public static EnumActionResult onPlaceItemIntoWorld(@Nonnull ItemUseContext context)
|
public static EnumActionResult onPlaceItemIntoWorld(@Nonnull ItemUseContext context)
|
||||||
{
|
{
|
||||||
ItemStack itemstack = context.func_195996_i();
|
ItemStack itemstack = context.getItem();
|
||||||
World world = context.func_195991_k();
|
World world = context.getWorld();
|
||||||
|
|
||||||
// handle all placement events here
|
// handle all placement events here
|
||||||
int meta = itemstack.getItemDamage();
|
int meta = itemstack.getItemDamage();
|
||||||
|
@ -826,7 +826,7 @@ public class ForgeHooks
|
||||||
world.captureBlockSnapshots = true;
|
world.captureBlockSnapshots = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
EnumActionResult ret = itemstack.getItem().func_195939_a(context);
|
EnumActionResult ret = itemstack.getItem().onItemUse(context);
|
||||||
world.captureBlockSnapshots = false;
|
world.captureBlockSnapshots = false;
|
||||||
|
|
||||||
if (ret == EnumActionResult.SUCCESS)
|
if (ret == EnumActionResult.SUCCESS)
|
||||||
|
@ -845,15 +845,15 @@ public class ForgeHooks
|
||||||
world.capturedBlockSnapshots.clear();
|
world.capturedBlockSnapshots.clear();
|
||||||
|
|
||||||
// make sure to set pre-placement item data for event
|
// make sure to set pre-placement item data for event
|
||||||
itemstack.func_196085_b(meta);
|
itemstack.setDamage(meta);
|
||||||
itemstack.setCount(size);
|
itemstack.setCount(size);
|
||||||
if (nbt != null)
|
if (nbt != null)
|
||||||
{
|
{
|
||||||
itemstack.setTagCompound(nbt);
|
itemstack.setTagCompound(nbt);
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityPlayer player = context.func_195999_j();
|
EntityPlayer player = context.getPlayer();
|
||||||
EnumFacing side = context.func_196000_l();
|
EnumFacing side = context.getFace();
|
||||||
|
|
||||||
if (blockSnapshots.size() > 1)
|
if (blockSnapshots.size() > 1)
|
||||||
{
|
{
|
||||||
|
@ -878,7 +878,7 @@ public class ForgeHooks
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Change the stack to its new content
|
// Change the stack to its new content
|
||||||
itemstack.func_196085_b(newMeta);
|
itemstack.setDamage(newMeta);
|
||||||
itemstack.setCount(newSize);
|
itemstack.setCount(newSize);
|
||||||
if (nbt != null)
|
if (nbt != null)
|
||||||
{
|
{
|
||||||
|
@ -940,7 +940,7 @@ public class ForgeHooks
|
||||||
if (stack.getItem().hasContainerItem(stack))
|
if (stack.getItem().hasContainerItem(stack))
|
||||||
{
|
{
|
||||||
stack = stack.getItem().getContainerItem(stack);
|
stack = stack.getItem().getContainerItem(stack);
|
||||||
if (!stack.isEmpty() && stack.isItemStackDamageable() && stack.getItemDamage() > stack.getMaxDamage())
|
if (!stack.isEmpty() && stack.isDamageable() && stack.getDamage() > stack.getMaxDamage())
|
||||||
{
|
{
|
||||||
ForgeEventFactory.onPlayerDestroyItem(craftingPlayer.get(), stack, null);
|
ForgeEventFactory.onPlayerDestroyItem(craftingPlayer.get(), stack, null);
|
||||||
return ItemStack.EMPTY;
|
return ItemStack.EMPTY;
|
||||||
|
@ -1232,7 +1232,7 @@ public class ForgeHooks
|
||||||
NBTTagList enchantmentsNbt = ItemEnchantedBook.getEnchantments(itemStack);
|
NBTTagList enchantmentsNbt = ItemEnchantedBook.getEnchantments(itemStack);
|
||||||
if (enchantmentsNbt.size() == 1)
|
if (enchantmentsNbt.size() == 1)
|
||||||
{
|
{
|
||||||
NBTTagCompound nbttagcompound = enchantmentsNbt.getCompoundTagAt(0);
|
NBTTagCompound nbttagcompound = enchantmentsNbt.getCompound(0);
|
||||||
Enchantment enchantment = Enchantment.getEnchantmentByID(nbttagcompound.getShort("id"));
|
Enchantment enchantment = Enchantment.getEnchantmentByID(nbttagcompound.getShort("id"));
|
||||||
if (enchantment != null)
|
if (enchantment != null)
|
||||||
{
|
{
|
||||||
|
@ -1255,7 +1255,7 @@ public class ForgeHooks
|
||||||
}
|
}
|
||||||
else if (item instanceof ItemSpawnEgg)
|
else if (item instanceof ItemSpawnEgg)
|
||||||
{
|
{
|
||||||
ResourceLocation resourceLocation = ((ItemSpawnEgg)item).func_208076_b(null).getRegistryName();
|
ResourceLocation resourceLocation = ((ItemSpawnEgg)item).getType(null).getRegistryName();
|
||||||
if (resourceLocation != null)
|
if (resourceLocation != null)
|
||||||
{
|
{
|
||||||
return resourceLocation.getNamespace();
|
return resourceLocation.getNamespace();
|
||||||
|
@ -1319,8 +1319,8 @@ public class ForgeHooks
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IFluidState func_204610_c(BlockPos p_204610_1_) {
|
public IFluidState getFluidState(BlockPos pos) {
|
||||||
return Fluids.field_204541_a.func_207188_f();
|
return Fluids.EMPTY.getDefaultState();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -323,7 +323,7 @@ public class ForgeMod implements WorldPersistenceHooks.WorldPersistenceHook
|
||||||
|
|
||||||
if (event.isWorldRunning() && tmpStairs != disableStairSlabCulling)
|
if (event.isWorldRunning() && tmpStairs != disableStairSlabCulling)
|
||||||
{
|
{
|
||||||
DistExecutor.runWhenOn(Dist.CLIENT,()->()-> Minecraft.getMinecraft().renderGlobal.loadRenderers());
|
DistExecutor.runWhenOn(Dist.CLIENT,()->()-> Minecraft.getInstance().renderGlobal.loadRenderers());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -435,7 +435,7 @@ public class ForgeMod implements WorldPersistenceHooks.WorldPersistenceHook
|
||||||
@Override
|
@Override
|
||||||
public void readData(SaveHandler handler, WorldInfo info, NBTTagCompound tag)
|
public void readData(SaveHandler handler, WorldInfo info, NBTTagCompound tag)
|
||||||
{
|
{
|
||||||
DimensionManager.loadDimensionDataMap(tag.hasKey("DimensionData") ? tag.getCompoundTag("DimensionData") : null);
|
DimensionManager.loadDimensionDataMap(tag.hasKey("DimensionData") ? tag.getCompound("DimensionData") : null);
|
||||||
// TODO fluids FluidRegistry.loadFluidDefaults(tag);
|
// TODO fluids FluidRegistry.loadFluidDefaults(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,4 +27,4 @@ public interface IPlantable
|
||||||
{
|
{
|
||||||
EnumPlantType getPlantType(IWorldReader world, BlockPos pos);
|
EnumPlantType getPlantType(IWorldReader world, BlockPos pos);
|
||||||
IBlockState getPlant(IWorldReader world, BlockPos pos);
|
IBlockState getPlant(IWorldReader world, BlockPos pos);
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,7 +137,7 @@ public interface ISpecialArmor
|
||||||
}
|
}
|
||||||
|
|
||||||
double totalArmor = entity.getTotalArmorValue();
|
double totalArmor = entity.getTotalArmorValue();
|
||||||
double totalToughness = entity.getEntityAttribute(SharedMonsterAttributes.ARMOR_TOUGHNESS).getAttributeValue();
|
double totalToughness = entity.getAttribute(SharedMonsterAttributes.ARMOR_TOUGHNESS).getValue();
|
||||||
|
|
||||||
if (source.isUnblockable())
|
if (source.isUnblockable())
|
||||||
{
|
{
|
||||||
|
@ -169,7 +169,7 @@ public interface ISpecialArmor
|
||||||
{
|
{
|
||||||
ItemArmor armor = (ItemArmor)stack.getItem();
|
ItemArmor armor = (ItemArmor)stack.getItem();
|
||||||
prop = new ArmorProperties(0, 0, Integer.MAX_VALUE);
|
prop = new ArmorProperties(0, 0, Integer.MAX_VALUE);
|
||||||
prop.Armor = armor.func_200881_e();
|
prop.Armor = armor.getDamageReduceAmount();
|
||||||
prop.Toughness = armor.getToughness();
|
prop.Toughness = armor.getToughness();
|
||||||
}
|
}
|
||||||
if (prop != null)
|
if (prop != null)
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class WorldSpecificSaveHandler implements ISaveHandler
|
||||||
@Override public IPlayerFileData getPlayerNBTManager() { return parent.getPlayerNBTManager(); }
|
@Override public IPlayerFileData getPlayerNBTManager() { return parent.getPlayerNBTManager(); }
|
||||||
@Override public void flush() { parent.flush(); }
|
@Override public void flush() { parent.flush(); }
|
||||||
@Override public File getWorldDirectory() { return parent.getWorldDirectory(); }
|
@Override public File getWorldDirectory() { return parent.getWorldDirectory(); }
|
||||||
@Override public DataFixer func_197718_i() { return parent.func_197718_i(); }
|
@Override public DataFixer getFixer() { return parent.getFixer(); }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public File getMapFileFromName(String name)
|
public File getMapFileFromName(String name)
|
||||||
|
@ -76,7 +76,7 @@ public class WorldSpecificSaveHandler implements ISaveHandler
|
||||||
File file = new File(dataDir, name + ".dat");
|
File file = new File(dataDir, name + ".dat");
|
||||||
if (!file.exists())
|
if (!file.exists())
|
||||||
{
|
{
|
||||||
switch (world.provider.getId())
|
switch (world.dimension.getId())
|
||||||
{
|
{
|
||||||
case -1:
|
case -1:
|
||||||
if (name.equalsIgnoreCase("FORTRESS")) copyFile(name, file);
|
if (name.equalsIgnoreCase("FORTRESS")) copyFile(name, file);
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class VanillaBrewingRecipe implements IBrewingRecipe {
|
||||||
public boolean isInput(ItemStack stack)
|
public boolean isInput(ItemStack stack)
|
||||||
{
|
{
|
||||||
Item item = stack.getItem();
|
Item item = stack.getItem();
|
||||||
return item == Items.POTIONITEM || item == Items.SPLASH_POTION || item == Items.LINGERING_POTION || item == Items.GLASS_BOTTLE;
|
return item == Items.POTION || item == Items.SPLASH_POTION || item == Items.LINGERING_POTION || item == Items.GLASS_BOTTLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -124,7 +124,7 @@ public class ChunkIOExecutor
|
||||||
ChunkIOProvider task = tasks.get(key);
|
ChunkIOProvider task = tasks.get(key);
|
||||||
if (task == null)
|
if (task == null)
|
||||||
{
|
{
|
||||||
LOGGER.warn("Attempted to dequeue chunk that wasn't queued? {} @ ({}, {})", world.provider.getId(), x, z);
|
LOGGER.warn("Attempted to dequeue chunk that wasn't queued? {} @ ({}, {})", world.dimension.getId(), x, z);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,8 +57,8 @@ class QueuedChunk {
|
||||||
result.append(" x: " + x + NEW_LINE);
|
result.append(" x: " + x + NEW_LINE);
|
||||||
result.append(" z: " + z + NEW_LINE);
|
result.append(" z: " + z + NEW_LINE);
|
||||||
result.append(" world: " + world.getWorldInfo().getWorldName() + NEW_LINE);
|
result.append(" world: " + world.getWorldInfo().getWorldName() + NEW_LINE);
|
||||||
result.append(" dimension: " + world.provider.getId() + NEW_LINE);
|
result.append(" dimension: " + world.dimension.getId() + NEW_LINE);
|
||||||
result.append(" provider: " + world.provider.getClass().getName() + NEW_LINE);
|
result.append(" provider: " + world.dimension.getClass().getName() + NEW_LINE);
|
||||||
result.append("}");
|
result.append("}");
|
||||||
|
|
||||||
return result.toString();
|
return result.toString();
|
||||||
|
|
|
@ -439,4 +439,4 @@ public class ConfigCategory implements Map<String, Property>
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,7 +118,7 @@ public class CompoundIngredient extends Ingredient
|
||||||
@Override
|
@Override
|
||||||
public CompoundIngredient parse(PacketBuffer buffer)
|
public CompoundIngredient parse(PacketBuffer buffer)
|
||||||
{
|
{
|
||||||
return new CompoundIngredient(Stream.generate(() -> Ingredient.func_199566_b(buffer)).limit(buffer.readVarInt()).collect(Collectors.toList()));
|
return new CompoundIngredient(Stream.generate(() -> Ingredient.fromBuffer(buffer)).limit(buffer.readVarInt()).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -131,7 +131,7 @@ public class CompoundIngredient extends Ingredient
|
||||||
public void write(PacketBuffer buffer, CompoundIngredient ingredient)
|
public void write(PacketBuffer buffer, CompoundIngredient ingredient)
|
||||||
{
|
{
|
||||||
buffer.writeVarInt(ingredient.children.size());
|
buffer.writeVarInt(ingredient.children.size());
|
||||||
ingredient.children.forEach(c -> c.func_199564_a(buffer));
|
ingredient.children.forEach(c -> c.writeToBuffer(buffer));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,11 +111,11 @@ public class CraftingHelper
|
||||||
public static final IIngredientSerializer<CompoundIngredient> INGREDIENT_COMPOUND = register(new ResourceLocation("forge", "compound"), new CompoundIngredient.Serializer());
|
public static final IIngredientSerializer<CompoundIngredient> INGREDIENT_COMPOUND = register(new ResourceLocation("forge", "compound"), new CompoundIngredient.Serializer());
|
||||||
public static final IIngredientSerializer<Ingredient> INGREDIENT_VANILLA = register(new ResourceLocation("minecraft", "item"), new IIngredientSerializer<Ingredient>() {
|
public static final IIngredientSerializer<Ingredient> INGREDIENT_VANILLA = register(new ResourceLocation("minecraft", "item"), new IIngredientSerializer<Ingredient>() {
|
||||||
public Ingredient parse(PacketBuffer buffer) {
|
public Ingredient parse(PacketBuffer buffer) {
|
||||||
return Ingredient.func_209357_a(Stream.generate(() -> new Ingredient.SingleItemList(buffer.readItemStack())).limit(buffer.readVarInt()));
|
return Ingredient.fromItemListStream(Stream.generate(() -> new Ingredient.SingleItemList(buffer.readItemStack())).limit(buffer.readVarInt()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Ingredient parse(JsonObject json) {
|
public Ingredient parse(JsonObject json) {
|
||||||
return Ingredient.func_209357_a(Stream.of(Ingredient.func_199803_a(json)));
|
return Ingredient.fromItemListStream(Stream.of(Ingredient.deserializeItemList(json)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void write(PacketBuffer buffer, Ingredient ingredient) {
|
public void write(PacketBuffer buffer, Ingredient ingredient) {
|
||||||
|
@ -248,9 +248,9 @@ public class CraftingHelper
|
||||||
|
|
||||||
tmp.setTag("tag", nbt);
|
tmp.setTag("tag", nbt);
|
||||||
tmp.setString("id", itemName);
|
tmp.setString("id", itemName);
|
||||||
tmp.setInteger("Count", JsonUtils.getInt(json, "count", 1));
|
tmp.setInt("Count", JsonUtils.getInt(json, "count", 1));
|
||||||
|
|
||||||
return ItemStack.func_199557_a(tmp);
|
return ItemStack.read(tmp);
|
||||||
}
|
}
|
||||||
catch (CommandSyntaxException e)
|
catch (CommandSyntaxException e)
|
||||||
{
|
{
|
||||||
|
@ -292,15 +292,15 @@ public class CraftingHelper
|
||||||
|
|
||||||
public static void reloadConstants(IResourceManager manager) {
|
public static void reloadConstants(IResourceManager manager) {
|
||||||
Map<ResourceLocation, IItemList> ret = new HashMap<>();
|
Map<ResourceLocation, IItemList> ret = new HashMap<>();
|
||||||
for(ResourceLocation key : manager.func_199003_a("recipes", filename -> filename.equals("_constants.json")))
|
for(ResourceLocation key : manager.getAllResourceLocations("recipes", filename -> filename.equals("_constants.json")))
|
||||||
{
|
{
|
||||||
String path = key.getPath();
|
String path = key.getPath();
|
||||||
if (!path.equals("recipes/_constants.json")) //Top level only
|
if (!path.equals("recipes/_constants.json")) //Top level only
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
try (IResource iresource = manager.func_199002_a(key))
|
try (IResource iresource = manager.getResource(key))
|
||||||
{
|
{
|
||||||
JsonObject[] elements = JsonUtils.gsonDeserialize(GSON, IOUtils.toString(iresource.func_199027_b(), StandardCharsets.UTF_8), JsonObject[].class);
|
JsonObject[] elements = JsonUtils.fromJson(GSON, IOUtils.toString(iresource.getInputStream(), StandardCharsets.UTF_8), JsonObject[].class);
|
||||||
for (int x = 0; x < elements.length; x++)
|
for (int x = 0; x < elements.length; x++)
|
||||||
{
|
{
|
||||||
JsonObject json = elements[x];
|
JsonObject json = elements[x];
|
||||||
|
@ -328,7 +328,7 @@ public class CraftingHelper
|
||||||
constants.put(new ResourceLocation(JsonUtils.getString(json, "name")), new StackList(items));
|
constants.put(new ResourceLocation(JsonUtils.getString(json, "name")), new StackList(items));
|
||||||
}
|
}
|
||||||
else if (json.has("tag"))
|
else if (json.has("tag"))
|
||||||
constants.put(new ResourceLocation(JsonUtils.getString(json, "name")), Ingredient.func_199803_a(json));
|
constants.put(new ResourceLocation(JsonUtils.getString(json, "name")), Ingredient.deserializeItemList(json));
|
||||||
else if (json.has("item"))
|
else if (json.has("item"))
|
||||||
constants.put(new ResourceLocation(JsonUtils.getString(json, "name")), new StackList(Lists.newArrayList(getItemStack(JsonUtils.getJsonObject(json, "item"), true))));
|
constants.put(new ResourceLocation(JsonUtils.getString(json, "name")), new StackList(Lists.newArrayList(getItemStack(JsonUtils.getJsonObject(json, "item"), true))));
|
||||||
else
|
else
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class IngredientNBT extends Ingredient
|
||||||
if (input == null)
|
if (input == null)
|
||||||
return false;
|
return false;
|
||||||
//Can't use areItemStacksEqualUsingNBTShareTag because it compares stack size as well
|
//Can't use areItemStacksEqualUsingNBTShareTag because it compares stack size as well
|
||||||
return this.stack.getItem() == input.getItem() && this.stack.getItemDamage() == input.getItemDamage() && ItemStack.areItemStackShareTagsEqual(this.stack, input);
|
return this.stack.getItem() == input.getItem() && this.stack.getDamage() == input.getDamage() && ItemStack.areItemStackShareTagsEqual(this.stack, input);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -37,13 +37,13 @@ public class StackList implements IItemList
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<ItemStack> func_199799_a()
|
public Collection<ItemStack> getStacks()
|
||||||
{
|
{
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JsonObject func_200303_b()
|
public JsonObject toJson()
|
||||||
{
|
{
|
||||||
if (items.size() == 1)
|
if (items.size() == 1)
|
||||||
return toJson(items.iterator().next());
|
return toJson(items.iterator().next());
|
||||||
|
@ -61,8 +61,8 @@ public class StackList implements IItemList
|
||||||
ret.addProperty("item", stack.getItem().getRegistryName().toString());
|
ret.addProperty("item", stack.getItem().getRegistryName().toString());
|
||||||
if (stack.getCount() != 1)
|
if (stack.getCount() != 1)
|
||||||
ret.addProperty("count", stack.getCount());
|
ret.addProperty("count", stack.getCount());
|
||||||
if (stack.getTagCompound() != null)
|
if (stack.getTag() != null)
|
||||||
ret.addProperty("nbt", stack.getTagCompound().toString()); //TODO: Better serialization?
|
ret.addProperty("nbt", stack.getTag().toString()); //TODO: Better serialization?
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,4 +23,4 @@
|
||||||
package net.minecraftforge.common.crafting;
|
package net.minecraftforge.common.crafting;
|
||||||
|
|
||||||
import mcp.MethodsReturnNonnullByDefault;
|
import mcp.MethodsReturnNonnullByDefault;
|
||||||
import javax.annotation.ParametersAreNonnullByDefault;
|
import javax.annotation.ParametersAreNonnullByDefault;
|
||||||
|
|
|
@ -139,7 +139,7 @@ public interface IForgeBlock
|
||||||
*/
|
*/
|
||||||
default boolean doesSideBlockRendering(IBlockState state, IWorldReader world, BlockPos pos, EnumFacing face)
|
default boolean doesSideBlockRendering(IBlockState state, IWorldReader world, BlockPos pos, EnumFacing face)
|
||||||
{
|
{
|
||||||
return state.func_200015_d(world, pos);
|
return state.isOpaqueCube(world, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -237,7 +237,7 @@ public interface IForgeBlock
|
||||||
{
|
{
|
||||||
if (world instanceof IWorldWriter)
|
if (world instanceof IWorldWriter)
|
||||||
{
|
{
|
||||||
((IWorldWriter)world).setBlockState(pos, state.func_206870_a(BlockBed.OCCUPIED,occupied), 4);
|
((IWorldWriter)world).setBlockState(pos, state.with(BlockBed.OCCUPIED,occupied), 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ public interface IForgeBlock
|
||||||
*/
|
*/
|
||||||
default EnumFacing getBedDirection(IBlockState state, IWorldReader world, BlockPos pos)
|
default EnumFacing getBedDirection(IBlockState state, IWorldReader world, BlockPos pos)
|
||||||
{
|
{
|
||||||
return state.getValue(BlockHorizontal.FACING);
|
return state.get(BlockHorizontal.HORIZONTAL_FACING);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -264,7 +264,7 @@ public interface IForgeBlock
|
||||||
*/
|
*/
|
||||||
default boolean isBedFoot(IBlockState state, IWorldReader world, BlockPos pos)
|
default boolean isBedFoot(IBlockState state, IWorldReader world, BlockPos pos)
|
||||||
{
|
{
|
||||||
return state.getValue(BlockBed.PART) == BedPart.FOOT;
|
return state.get(BlockBed.PART) == BedPart.FOOT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -408,7 +408,7 @@ public interface IForgeBlock
|
||||||
default boolean canPlaceTorchOnTop(IBlockState state, IWorldReader world, BlockPos pos)
|
default boolean canPlaceTorchOnTop(IBlockState state, IWorldReader world, BlockPos pos)
|
||||||
{
|
{
|
||||||
if (state.isTopSolid() || state.getBlockFaceShape(world, pos, EnumFacing.UP) == BlockFaceShape.SOLID)
|
if (state.isTopSolid() || state.getBlockFaceShape(world, pos, EnumFacing.UP) == BlockFaceShape.SOLID)
|
||||||
return this.getBlock() != Blocks.END_GATEWAY && this.getBlock() != Blocks.field_196628_cT;
|
return this.getBlock() != Blocks.END_GATEWAY && this.getBlock() != Blocks.JACK_O_LANTERN;
|
||||||
else
|
else
|
||||||
return this.getBlock() instanceof BlockFence || this.getBlock() == Blocks.COBBLESTONE_WALL || this.getBlock() instanceof BlockGlass;
|
return this.getBlock() instanceof BlockFence || this.getBlock() == Blocks.COBBLESTONE_WALL || this.getBlock() instanceof BlockGlass;
|
||||||
}
|
}
|
||||||
|
@ -514,19 +514,19 @@ public interface IForgeBlock
|
||||||
return this.getBlock() == Blocks.CACTUS && this.getBlock() == Blocks.SAND;
|
return this.getBlock() == Blocks.CACTUS && this.getBlock() == Blocks.SAND;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plant.getBlock() == Blocks.field_196608_cF)
|
if (plant.getBlock() == Blocks.SUGAR_CANE)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plantable instanceof BlockBush && ((BlockBush)plantable).func_196260_a(state, world, pos))
|
if (plantable instanceof BlockBush && ((BlockBush)plantable).isValidPosition(state, world, pos))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case Desert: return this.getBlock() == Blocks.SAND || this.getBlock() == Blocks.HARDENED_CLAY ||
|
case Desert: return this.getBlock() == Blocks.SAND || this.getBlock() == Blocks.TERRACOTTA ||
|
||||||
this.getBlock() instanceof BlockGlazedTerracotta;
|
this.getBlock() instanceof BlockGlazedTerracotta;
|
||||||
case Nether: return this.getBlock() == Blocks.SOUL_SAND;
|
case Nether: return this.getBlock() == Blocks.SOUL_SAND;
|
||||||
case Crop: return this.getBlock() == Blocks.FARMLAND;
|
case Crop: return this.getBlock() == Blocks.FARMLAND;
|
||||||
|
@ -578,7 +578,7 @@ public interface IForgeBlock
|
||||||
default boolean isFertile(IBlockState state, IWorldReader world, BlockPos pos)
|
default boolean isFertile(IBlockState state, IWorldReader world, BlockPos pos)
|
||||||
{
|
{
|
||||||
if (this.getBlock() == Blocks.FARMLAND)
|
if (this.getBlock() == Blocks.FARMLAND)
|
||||||
return state.getValue(BlockFarmland.MOISTURE) > 0;
|
return state.get(BlockFarmland.MOISTURE) > 0;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -598,7 +598,7 @@ public interface IForgeBlock
|
||||||
*/
|
*/
|
||||||
default int getLightOpacity(IBlockState state, IWorldReader world, BlockPos pos)
|
default int getLightOpacity(IBlockState state, IWorldReader world, BlockPos pos)
|
||||||
{
|
{
|
||||||
return state.func_200016_a(world, pos);
|
return state.getOpacity(world, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -630,7 +630,7 @@ public interface IForgeBlock
|
||||||
|
|
||||||
default boolean rotateBlock(IBlockState state, IWorld world, BlockPos pos, EnumFacing axis)
|
default boolean rotateBlock(IBlockState state, IWorld world, BlockPos pos, EnumFacing axis)
|
||||||
{
|
{
|
||||||
state.func_206871_b().keySet().forEach(prop ->
|
state.getValues().keySet().forEach(prop ->
|
||||||
{
|
{
|
||||||
if (prop.getName().equals("facing") || prop.getName().equals("rotation") && prop.getValueClass() == EnumFacing.class)
|
if (prop.getName().equals("facing") || prop.getName().equals("rotation") && prop.getValueClass() == EnumFacing.class)
|
||||||
{
|
{
|
||||||
|
@ -640,13 +640,13 @@ public interface IForgeBlock
|
||||||
IBlockState newState;
|
IBlockState newState;
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
IProperty<EnumFacing> facingIProperty = (IProperty<EnumFacing>) prop;
|
IProperty<EnumFacing> facingIProperty = (IProperty<EnumFacing>) prop;
|
||||||
EnumFacing facing = state.getValue(facingIProperty);
|
EnumFacing facing = state.get(facingIProperty);
|
||||||
Collection<EnumFacing> validFacing = facingIProperty.getAllowedValues();
|
Collection<EnumFacing> validFacing = facingIProperty.getAllowedValues();
|
||||||
|
|
||||||
// rotate horizontal facings clockwise
|
// rotate horizontal facings clockwise
|
||||||
if (validFacing.size() == 4 && !validFacing.contains(EnumFacing.UP) && !validFacing.contains(EnumFacing.DOWN))
|
if (validFacing.size() == 4 && !validFacing.contains(EnumFacing.UP) && !validFacing.contains(EnumFacing.DOWN))
|
||||||
{
|
{
|
||||||
newState = state.func_206870_a(facingIProperty, facing.rotateY());
|
newState = state.with(facingIProperty, facing.rotateY());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -654,11 +654,11 @@ public interface IForgeBlock
|
||||||
EnumFacing rotatedFacing = facing.rotateAround(axis.getAxis());
|
EnumFacing rotatedFacing = facing.rotateAround(axis.getAxis());
|
||||||
if (validFacing.contains(rotatedFacing))
|
if (validFacing.contains(rotatedFacing))
|
||||||
{
|
{
|
||||||
newState = state.func_206870_a(facingIProperty, rotatedFacing);
|
newState = state.with(facingIProperty, rotatedFacing);
|
||||||
}
|
}
|
||||||
else // abnormal facing property, just cycle it
|
else // abnormal facing property, just cycle it
|
||||||
{
|
{
|
||||||
newState = state.cycleProperty(facingIProperty);
|
newState = state.cycle(facingIProperty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -879,7 +879,7 @@ public interface IForgeBlock
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
default IBlockState getStateForPlacement(IBlockState state, EnumFacing facing, IBlockState state2, IWorld world, BlockPos pos1, BlockPos pos2, EnumHand hand)
|
default IBlockState getStateForPlacement(IBlockState state, EnumFacing facing, IBlockState state2, IWorld world, BlockPos pos1, BlockPos pos2, EnumHand hand)
|
||||||
{
|
{
|
||||||
return this.getBlock().func_196271_a(state, facing, state2, world, pos1, pos2);
|
return this.getBlock().updatePostPlacement(state, facing, state2, world, pos1, pos2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ public interface IForgeEntity extends ICapabilitySerializable<NBTTagCompound>
|
||||||
|
|
||||||
default void deserializeNBT(NBTTagCompound nbt)
|
default void deserializeNBT(NBTTagCompound nbt)
|
||||||
{
|
{
|
||||||
getEntity().readFromNBT(nbt);
|
getEntity().read(nbt);
|
||||||
}
|
}
|
||||||
|
|
||||||
default NBTTagCompound serializeNBT()
|
default NBTTagCompound serializeNBT()
|
||||||
|
@ -63,7 +63,7 @@ public interface IForgeEntity extends ICapabilitySerializable<NBTTagCompound>
|
||||||
{
|
{
|
||||||
ret.setString("id", getEntity().getEntityString());
|
ret.setString("id", getEntity().getEntityString());
|
||||||
}
|
}
|
||||||
return getEntity().writeToNBT(ret);
|
return getEntity().writeWithoutTypeId(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean canUpdate();
|
boolean canUpdate();
|
||||||
|
@ -125,7 +125,7 @@ public interface IForgeEntity extends ICapabilitySerializable<NBTTagCompound>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ItemSpawnEgg egg = ItemSpawnEgg.func_200889_b(getEntity().func_200600_R());
|
ItemSpawnEgg egg = ItemSpawnEgg.getEgg(getEntity().getType());
|
||||||
if (egg != null) return new ItemStack(egg);
|
if (egg != null) return new ItemStack(egg);
|
||||||
}
|
}
|
||||||
return ItemStack.EMPTY;
|
return ItemStack.EMPTY;
|
||||||
|
|
|
@ -52,7 +52,7 @@ public interface IForgeFluid
|
||||||
*/
|
*/
|
||||||
default boolean isEntityInside(IFluidState state, IWorldReader world, BlockPos pos, Entity entity, double yToTest, Tag<Fluid> tag, boolean testingHead)
|
default boolean isEntityInside(IFluidState state, IWorldReader world, BlockPos pos, Entity entity, double yToTest, Tag<Fluid> tag, boolean testingHead)
|
||||||
{
|
{
|
||||||
return state.func_206884_a(tag) && yToTest - pos.getY() < state.func_206885_f() + 0.1F;
|
return state.isTagged(tag) && yToTest - pos.getY() < state.getHeight() + 0.1F;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -96,6 +96,6 @@ public interface IForgeFluid
|
||||||
*/
|
*/
|
||||||
default float getExplosionResistance(IFluidState state, IWorldReader world, BlockPos pos, @Nullable Entity exploder, Explosion explosion)
|
default float getExplosionResistance(IFluidState state, IWorldReader world, BlockPos pos, @Nullable Entity exploder, Explosion explosion)
|
||||||
{
|
{
|
||||||
return state.func_210200_l();
|
return state.getExplosionResistance();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ public interface IForgeFluidState
|
||||||
*/
|
*/
|
||||||
default boolean isEntityInside(IWorldReader world, BlockPos pos, Entity entity, double yToTest, Tag<Fluid> tag, boolean testingHead)
|
default boolean isEntityInside(IWorldReader world, BlockPos pos, Entity entity, double yToTest, Tag<Fluid> tag, boolean testingHead)
|
||||||
{
|
{
|
||||||
return getFluidState().func_206886_c().isEntityInside(getFluidState(), world, pos, entity, yToTest, tag, testingHead);
|
return getFluidState().getFluid().isEntityInside(getFluidState(), world, pos, entity, yToTest, tag, testingHead);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,6 +65,6 @@ public interface IForgeFluidState
|
||||||
*/
|
*/
|
||||||
default float getExplosionResistance(IWorldReader world, BlockPos pos, @Nullable Entity exploder, Explosion explosion)
|
default float getExplosionResistance(IWorldReader world, BlockPos pos, @Nullable Entity exploder, Explosion explosion)
|
||||||
{
|
{
|
||||||
return getFluidState().func_206886_c().getExplosionResistance(getFluidState(), world, pos, exploder, explosion);
|
return getFluidState().getFluid().getExplosionResistance(getFluidState(), world, pos, exploder, explosion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@ public interface IForgeItem
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
default Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack)
|
default Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack)
|
||||||
{
|
{
|
||||||
return getItem().getItemAttributeModifiers(slot);
|
return getItem().getAttributeModifiers(slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -133,7 +133,7 @@ public interface IForgeItem
|
||||||
@Nullable
|
@Nullable
|
||||||
default NBTTagCompound getNBTShareTag(ItemStack stack)
|
default NBTTagCompound getNBTShareTag(ItemStack stack)
|
||||||
{
|
{
|
||||||
return stack.getTagCompound();
|
return stack.getTag();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -145,7 +145,7 @@ public interface IForgeItem
|
||||||
*/
|
*/
|
||||||
default void readNBTShareTag(ItemStack stack, @Nullable NBTTagCompound nbt)
|
default void readNBTShareTag(ItemStack stack, @Nullable NBTTagCompound nbt)
|
||||||
{
|
{
|
||||||
stack.setTagCompound(nbt);
|
stack.setTag(nbt);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -286,7 +286,7 @@ public interface IForgeItem
|
||||||
*/
|
*/
|
||||||
default java.util.Collection<ItemGroup> getCreativeTabs()
|
default java.util.Collection<ItemGroup> getCreativeTabs()
|
||||||
{
|
{
|
||||||
return java.util.Collections.singletonList(getItem().getCreativeTab());
|
return java.util.Collections.singletonList(getItem().getGroup());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -454,7 +454,7 @@ public interface IForgeItem
|
||||||
*/
|
*/
|
||||||
default int getDamage(ItemStack stack)
|
default int getDamage(ItemStack stack)
|
||||||
{
|
{
|
||||||
return !stack.hasTagCompound() ? 0 : stack.getTagCompound().getInteger("Damage");
|
return !stack.hasTag() ? 0 : stack.getTag().getInt("Damage");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -467,7 +467,7 @@ public interface IForgeItem
|
||||||
*/
|
*/
|
||||||
default boolean showDurabilityBar(ItemStack stack)
|
default boolean showDurabilityBar(ItemStack stack)
|
||||||
{
|
{
|
||||||
return stack.isItemDamaged();
|
return stack.isDamaged();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -479,7 +479,7 @@ public interface IForgeItem
|
||||||
*/
|
*/
|
||||||
default double getDurabilityForDisplay(ItemStack stack)
|
default double getDurabilityForDisplay(ItemStack stack)
|
||||||
{
|
{
|
||||||
return (double) stack.getItemDamage() / (double) stack.getMaxDamage();
|
return (double) stack.getDamage() / (double) stack.getMaxDamage();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -517,7 +517,7 @@ public interface IForgeItem
|
||||||
*/
|
*/
|
||||||
default boolean isDamaged(ItemStack stack)
|
default boolean isDamaged(ItemStack stack)
|
||||||
{
|
{
|
||||||
return stack.getItemDamage() > 0;
|
return stack.getDamage() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -529,7 +529,7 @@ public interface IForgeItem
|
||||||
*/
|
*/
|
||||||
default void setDamage(ItemStack stack, int damage)
|
default void setDamage(ItemStack stack, int damage)
|
||||||
{
|
{
|
||||||
stack.func_196082_o().setInteger("Damage", Math.max(0, damage));
|
stack.getOrCreateTag().setInt("Damage", Math.max(0, damage));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -570,7 +570,7 @@ public interface IForgeItem
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
default int getItemStackLimit(ItemStack stack)
|
default int getItemStackLimit(ItemStack stack)
|
||||||
{
|
{
|
||||||
return getItem().getItemStackLimit();
|
return getItem().getMaxStackSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<ToolType> getToolTypes(ItemStack stack);
|
Set<ToolType> getToolTypes(ItemStack stack);
|
||||||
|
@ -654,7 +654,7 @@ public interface IForgeItem
|
||||||
default boolean shouldCauseBlockBreakReset(ItemStack oldStack, ItemStack newStack)
|
default boolean shouldCauseBlockBreakReset(ItemStack oldStack, ItemStack newStack)
|
||||||
{
|
{
|
||||||
return !(newStack.getItem() == oldStack.getItem() && ItemStack.areItemStackTagsEqual(newStack, oldStack)
|
return !(newStack.getItem() == oldStack.getItem() && ItemStack.areItemStackTagsEqual(newStack, oldStack)
|
||||||
&& (newStack.isItemStackDamageable() || newStack.getItemDamage() == oldStack.getItemDamage()));
|
&& (newStack.isDamageable() || newStack.getDamage() == oldStack.getDamage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -704,7 +704,7 @@ public interface IForgeItem
|
||||||
.builder();
|
.builder();
|
||||||
for (ResourceLocation location : ((RegistrySimple<ResourceLocation, IItemPropertyGetter>) getItem().properties).getKeys())
|
for (ResourceLocation location : ((RegistrySimple<ResourceLocation, IItemPropertyGetter>) getItem().properties).getKeys())
|
||||||
{
|
{
|
||||||
final IItemPropertyGetter parameter = getItem().properties.getObject(location);
|
final IItemPropertyGetter parameter = getItem().properties.get(location);
|
||||||
builder.put(location.toString(), input -> parameter.call(stack, world, entity));
|
builder.put(location.toString(), input -> parameter.call(stack, world, entity));
|
||||||
}
|
}
|
||||||
return builder.build();
|
return builder.build();
|
||||||
|
|
|
@ -101,16 +101,16 @@ public interface IForgeItemStack extends ICapabilitySerializable<NBTTagCompound>
|
||||||
|
|
||||||
default EnumActionResult onItemUseFirst(ItemUseContext context)
|
default EnumActionResult onItemUseFirst(ItemUseContext context)
|
||||||
{
|
{
|
||||||
EntityPlayer entityplayer = context.func_195999_j();
|
EntityPlayer entityplayer = context.getPlayer();
|
||||||
BlockPos blockpos = context.func_195995_a();
|
BlockPos blockpos = context.getPos();
|
||||||
BlockWorldState blockworldstate = new BlockWorldState(context.func_195991_k(), blockpos, false);
|
BlockWorldState blockworldstate = new BlockWorldState(context.getWorld(), blockpos, false);
|
||||||
if (entityplayer != null && !entityplayer.capabilities.allowEdit && !getStack().func_206847_b(context.func_195991_k().func_205772_D(), blockworldstate)) {
|
if (entityplayer != null && !entityplayer.abilities.allowEdit && !getStack().canPlaceOn(context.getWorld().getTags(), blockworldstate)) {
|
||||||
return EnumActionResult.PASS;
|
return EnumActionResult.PASS;
|
||||||
} else {
|
} else {
|
||||||
Item item = getStack().getItem();
|
Item item = getStack().getItem();
|
||||||
EnumActionResult enumactionresult = item.onItemUseFirst(getStack(), context);
|
EnumActionResult enumactionresult = item.onItemUseFirst(getStack(), context);
|
||||||
if (entityplayer != null && enumactionresult == EnumActionResult.SUCCESS) {
|
if (entityplayer != null && enumactionresult == EnumActionResult.SUCCESS) {
|
||||||
entityplayer.addStat(StatList.OBJECT_USE_STATS.func_199076_b(item));
|
entityplayer.addStat(StatList.ITEM_USED.get(item));
|
||||||
}
|
}
|
||||||
|
|
||||||
return enumactionresult;
|
return enumactionresult;
|
||||||
|
@ -120,7 +120,7 @@ public interface IForgeItemStack extends ICapabilitySerializable<NBTTagCompound>
|
||||||
default NBTTagCompound serializeNBT()
|
default NBTTagCompound serializeNBT()
|
||||||
{
|
{
|
||||||
NBTTagCompound ret = new NBTTagCompound();
|
NBTTagCompound ret = new NBTTagCompound();
|
||||||
getStack().writeToNBT(ret);
|
getStack().write(ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,14 +30,14 @@ public interface IForgeTileEntity extends ICapabilitySerializable<NBTTagCompound
|
||||||
@Override
|
@Override
|
||||||
default void deserializeNBT(NBTTagCompound nbt)
|
default void deserializeNBT(NBTTagCompound nbt)
|
||||||
{
|
{
|
||||||
getTileEntity().readFromNBT(nbt);
|
getTileEntity().read(nbt);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
default NBTTagCompound serializeNBT()
|
default NBTTagCompound serializeNBT()
|
||||||
{
|
{
|
||||||
NBTTagCompound ret = new NBTTagCompound();
|
NBTTagCompound ret = new NBTTagCompound();
|
||||||
getTileEntity().writeToNBT(ret);
|
getTileEntity().write(ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,4 +33,4 @@ public interface IModelState
|
||||||
* if no part is provided, global model transformation is returned.
|
* if no part is provided, global model transformation is returned.
|
||||||
*/
|
*/
|
||||||
Optional<TRSRTransformation> apply(Optional<? extends IModelPart> part);
|
Optional<TRSRTransformation> apply(Optional<? extends IModelPart> part);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraft.util.EnumFacing;
|
||||||
*/
|
*/
|
||||||
public interface ITransformation
|
public interface ITransformation
|
||||||
{
|
{
|
||||||
Matrix4f getMatrix();
|
Matrix4f getMatrixVec();
|
||||||
|
|
||||||
EnumFacing rotate(EnumFacing facing);
|
EnumFacing rotate(EnumFacing facing);
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ public final class TRSRTransformation implements IModelState, ITransformation
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public static Matrix4f getMatrix(EnumFacing facing)
|
public static Matrix4f getMatrix(EnumFacing facing)
|
||||||
{
|
{
|
||||||
return getRotation(facing).getMatrix();
|
return getRotation(facing).getMatrixVec();
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
|
@ -153,15 +153,15 @@ public final class TRSRTransformation implements IModelState, ITransformation
|
||||||
{
|
{
|
||||||
if (this.isIdentity()) return b;
|
if (this.isIdentity()) return b;
|
||||||
if (b.isIdentity()) return this;
|
if (b.isIdentity()) return this;
|
||||||
Matrix4f m = getMatrix();
|
Matrix4f m = getMatrixVec();
|
||||||
m.mul(b.getMatrix());
|
m.mul(b.getMatrixVec());
|
||||||
return new TRSRTransformation(m);
|
return new TRSRTransformation(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TRSRTransformation inverse()
|
public TRSRTransformation inverse()
|
||||||
{
|
{
|
||||||
if (this.isIdentity()) return this;
|
if (this.isIdentity()) return this;
|
||||||
Matrix4f m = getMatrix();
|
Matrix4f m = getMatrixVec();
|
||||||
m.invert();
|
m.invert();
|
||||||
return new TRSRTransformation(m);
|
return new TRSRTransformation(m);
|
||||||
}
|
}
|
||||||
|
@ -547,7 +547,7 @@ public final class TRSRTransformation implements IModelState, ITransformation
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Matrix4f getMatrix()
|
public Matrix4f getMatrixVec()
|
||||||
{
|
{
|
||||||
return (Matrix4f)matrix.clone();
|
return (Matrix4f)matrix.clone();
|
||||||
}
|
}
|
||||||
|
@ -645,7 +645,7 @@ public final class TRSRTransformation implements IModelState, ITransformation
|
||||||
{
|
{
|
||||||
if (transform.isIdentity()) return transform;
|
if (transform.isIdentity()) return transform;
|
||||||
|
|
||||||
Matrix4f ret = new Matrix4f(transform.getMatrix()), tmp = new Matrix4f();
|
Matrix4f ret = new Matrix4f(transform.getMatrixVec()), tmp = new Matrix4f();
|
||||||
tmp.setIdentity();
|
tmp.setIdentity();
|
||||||
tmp.m03 = tmp.m13 = tmp.m23 = .5f;
|
tmp.m03 = tmp.m13 = tmp.m23 = .5f;
|
||||||
ret.mul(tmp, ret);
|
ret.mul(tmp, ret);
|
||||||
|
@ -661,7 +661,7 @@ public final class TRSRTransformation implements IModelState, ITransformation
|
||||||
{
|
{
|
||||||
if (transform.isIdentity()) return transform;
|
if (transform.isIdentity()) return transform;
|
||||||
|
|
||||||
Matrix4f ret = new Matrix4f(transform.getMatrix()), tmp = new Matrix4f();
|
Matrix4f ret = new Matrix4f(transform.getMatrixVec()), tmp = new Matrix4f();
|
||||||
tmp.setIdentity();
|
tmp.setIdentity();
|
||||||
tmp.m03 = tmp.m13 = tmp.m23 = -.5f;
|
tmp.m03 = tmp.m13 = tmp.m23 = -.5f;
|
||||||
ret.mul(tmp, ret);
|
ret.mul(tmp, ret);
|
||||||
|
@ -692,28 +692,28 @@ public final class TRSRTransformation implements IModelState, ITransformation
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public static Vector3f toVecmath(net.minecraft.client.renderer.Vector3f vec)
|
public static Vector3f toVecmath(net.minecraft.client.renderer.Vector3f vec)
|
||||||
{
|
{
|
||||||
return new Vector3f(vec.func_195899_a(), vec.func_195900_b(), vec.func_195902_c());
|
return new Vector3f(vec.getX(), vec.getY(), vec.getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public static Vector4f toVecmath(net.minecraft.client.renderer.Vector4f vec)
|
public static Vector4f toVecmath(net.minecraft.client.renderer.Vector4f vec)
|
||||||
{
|
{
|
||||||
return new Vector4f(vec.func_195910_a(), vec.func_195913_b(), vec.func_195914_c(), vec.func_195915_d());
|
return new Vector4f(vec.getX(), vec.getY(), vec.getZ(), vec.getW());
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public static Matrix4f toVecmath(net.minecraft.client.renderer.Matrix4f m)
|
public static Matrix4f toVecmath(net.minecraft.client.renderer.Matrix4f m)
|
||||||
{
|
{
|
||||||
return new Matrix4f(
|
return new Matrix4f(
|
||||||
m.func_195885_a(0, 0), m.func_195885_a(1, 0), m.func_195885_a(2, 0), m.func_195885_a(3, 0),
|
m.get(0, 0), m.get(1, 0), m.get(2, 0), m.get(3, 0),
|
||||||
m.func_195885_a(0, 1), m.func_195885_a(1, 1), m.func_195885_a(2, 1), m.func_195885_a(3, 1),
|
m.get(0, 1), m.get(1, 1), m.get(2, 1), m.get(3, 1),
|
||||||
m.func_195885_a(0, 2), m.func_195885_a(1, 2), m.func_195885_a(2, 2), m.func_195885_a(3, 2),
|
m.get(0, 2), m.get(1, 2), m.get(2, 2), m.get(3, 2),
|
||||||
m.func_195885_a(0, 3), m.func_195885_a(1, 3), m.func_195885_a(2, 3), m.func_195885_a(3, 3));
|
m.get(0, 3), m.get(1, 3), m.get(2, 3), m.get(3, 3));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Quat4f toVecmath(net.minecraft.client.renderer.Quaternion q)
|
public static Quat4f toVecmath(net.minecraft.client.renderer.Quaternion q)
|
||||||
{
|
{
|
||||||
return new Quat4f(q.func_195889_a(), q.func_195891_b(), q.func_195893_c(), q.func_195894_d());
|
return new Quat4f(q.getX(), q.getY(), q.getZ(), q.getW());
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
|
@ -738,7 +738,7 @@ public final class TRSRTransformation implements IModelState, ITransformation
|
||||||
m.getRow(x, row);
|
m.getRow(x, row);
|
||||||
for (int y = 0; y < 4; y++)
|
for (int y = 0; y < 4; y++)
|
||||||
{
|
{
|
||||||
r.func_195878_a(x, y, row[y]);
|
r.set(x, y, row[y]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
|
|
|
@ -218,13 +218,13 @@ public final class AnimationStateMachine implements IAnimationStateMachine
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public static IAnimationStateMachine load(IResourceManager manager, ResourceLocation location, ImmutableMap<String, ITimeValue> customParameters)
|
public static IAnimationStateMachine load(IResourceManager manager, ResourceLocation location, ImmutableMap<String, ITimeValue> customParameters)
|
||||||
{
|
{
|
||||||
try (IResource resource = manager.func_199002_a(location))
|
try (IResource resource = manager.getResource(location))
|
||||||
{
|
{
|
||||||
ClipResolver clipResolver = new ClipResolver();
|
ClipResolver clipResolver = new ClipResolver();
|
||||||
ParameterResolver parameterResolver = new ParameterResolver(customParameters);
|
ParameterResolver parameterResolver = new ParameterResolver(customParameters);
|
||||||
Clips.CommonClipTypeAdapterFactory.INSTANCE.setClipResolver(clipResolver);
|
Clips.CommonClipTypeAdapterFactory.INSTANCE.setClipResolver(clipResolver);
|
||||||
TimeValues.CommonTimeValueTypeAdapterFactory.INSTANCE.setValueResolver(parameterResolver);
|
TimeValues.CommonTimeValueTypeAdapterFactory.INSTANCE.setValueResolver(parameterResolver);
|
||||||
AnimationStateMachine asm = asmGson.fromJson(new InputStreamReader(resource.func_199027_b(), StandardCharsets.UTF_8), AnimationStateMachine.class);
|
AnimationStateMachine asm = asmGson.fromJson(new InputStreamReader(resource.getInputStream(), StandardCharsets.UTF_8), AnimationStateMachine.class);
|
||||||
clipResolver.asm = asm;
|
clipResolver.asm = asm;
|
||||||
parameterResolver.asm = asm;
|
parameterResolver.asm = asm;
|
||||||
asm.initialize();
|
asm.initialize();
|
||||||
|
|
|
@ -580,4 +580,4 @@ public final class Clips
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,4 +44,4 @@ public class FluidIdRegistryMessageHandler extends SimpleChannelInboundHandler<F
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -56,4 +56,4 @@ public class ForgeNetworkHandler
|
||||||
clientChannel.pipeline().addAfter(handlerName, "FluidIdRegistryHandler", new FluidIdRegistryMessageHandler());
|
clientChannel.pipeline().addAfter(handlerName, "FluidIdRegistryHandler", new FluidIdRegistryMessageHandler());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -41,4 +41,4 @@ public class ForgeRuntimeCodec extends FMLIndexedMessageToMessageCodec<ForgeMess
|
||||||
msg.fromBytes(source);
|
msg.fromBytes(source);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -36,4 +36,4 @@ public class ServerToClientConnectionEstablishedHandler extends ChannelInboundHa
|
||||||
ctx.fireUserEventTriggered(evt);
|
ctx.fireUserEventTriggered(evt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -99,9 +99,9 @@ public class ExtendedStateContainer<O, S extends IExtendedState<S>> extends Stat
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Nonnull
|
@Nonnull
|
||||||
public <T extends Comparable<T>, V extends T> S func_206870_a(@Nonnull IProperty<T> property, @Nonnull V value)
|
public <T extends Comparable<T>, V extends T> S with(@Nonnull IProperty<T> property, @Nonnull V value)
|
||||||
{
|
{
|
||||||
S clean = super.func_206870_a(property, value);
|
S clean = super.with(property, value);
|
||||||
if (clean == this.cleanState) {
|
if (clean == this.cleanState) {
|
||||||
return (S) this;
|
return (S) this;
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ public class ExtendedStateContainer<O, S extends IExtendedState<S>> extends Stat
|
||||||
return clean;
|
return clean;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (S) new ExtendedStateHolder(field_206876_a, ((IStateHolder)clean).func_206871_b(), unlistedProperties, this.cleanState);
|
return (S) new ExtendedStateHolder(object, ((IStateHolder)clean).getValues(), unlistedProperties, this.cleanState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -128,7 +128,7 @@ public class ExtendedStateContainer<O, S extends IExtendedState<S>> extends Stat
|
||||||
}
|
}
|
||||||
if (!property.isValid(value))
|
if (!property.isValid(value))
|
||||||
{
|
{
|
||||||
throw new IllegalArgumentException("Cannot set unlisted property " + property + " to " + value + " on object " + field_206876_a + ", it is not an allowed value");
|
throw new IllegalArgumentException("Cannot set unlisted property " + property + " to " + value + " on object " + object + ", it is not an allowed value");
|
||||||
}
|
}
|
||||||
boolean clean = true;
|
boolean clean = true;
|
||||||
ImmutableMap.Builder<IUnlistedProperty<?>, Optional<?>> builder = ImmutableMap.builder();
|
ImmutableMap.Builder<IUnlistedProperty<?>, Optional<?>> builder = ImmutableMap.builder();
|
||||||
|
@ -143,7 +143,7 @@ public class ExtendedStateContainer<O, S extends IExtendedState<S>> extends Stat
|
||||||
{ // no dynamic properties, lookup normal state
|
{ // no dynamic properties, lookup normal state
|
||||||
return (S) cleanState;
|
return (S) cleanState;
|
||||||
}
|
}
|
||||||
return (S) new ExtendedStateHolder(field_206876_a, func_206871_b(), builder.build(), this.cleanState);
|
return (S) new ExtendedStateHolder(object, getValues(), builder.build(), this.cleanState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class BlockSnapshot
|
||||||
public BlockSnapshot(World world, BlockPos pos, IBlockState state, @Nullable NBTTagCompound nbt)
|
public BlockSnapshot(World world, BlockPos pos, IBlockState state, @Nullable NBTTagCompound nbt)
|
||||||
{
|
{
|
||||||
this.setWorld(world);
|
this.setWorld(world);
|
||||||
this.dimId = world.provider.getId();
|
this.dimId = world.dimension.getId();
|
||||||
this.pos = pos.toImmutable();
|
this.pos = pos.toImmutable();
|
||||||
this.setReplacedBlock(state);
|
this.setReplacedBlock(state);
|
||||||
this.registryName = state.getBlock().getRegistryName();
|
this.registryName = state.getBlock().getRegistryName();
|
||||||
|
@ -113,12 +113,12 @@ public class BlockSnapshot
|
||||||
public static BlockSnapshot readFromNBT(NBTTagCompound tag)
|
public static BlockSnapshot readFromNBT(NBTTagCompound tag)
|
||||||
{
|
{
|
||||||
return new BlockSnapshot(
|
return new BlockSnapshot(
|
||||||
tag.getInteger("dimension"),
|
tag.getInt("dimension"),
|
||||||
new BlockPos(tag.getInteger("posX"), tag.getInteger("posY"), tag.getInteger("posZ")),
|
new BlockPos(tag.getInt("posX"), tag.getInt("posY"), tag.getInt("posZ")),
|
||||||
new ResourceLocation(tag.getString("blockMod"), tag.getString("blockName")),
|
new ResourceLocation(tag.getString("blockMod"), tag.getString("blockName")),
|
||||||
tag.getInteger("metadata"),
|
tag.getInt("metadata"),
|
||||||
tag.getInteger("flag"),
|
tag.getInt("flag"),
|
||||||
tag.getBoolean("hasTE") ? tag.getCompoundTag("tileEntity") : null);
|
tag.getBoolean("hasTE") ? tag.getCompound("tileEntity") : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
|
@ -126,7 +126,7 @@ public class BlockSnapshot
|
||||||
{
|
{
|
||||||
if (te == null) return null;
|
if (te == null) return null;
|
||||||
NBTTagCompound nbt = new NBTTagCompound();
|
NBTTagCompound nbt = new NBTTagCompound();
|
||||||
te.writeToNBT(nbt);
|
te.write(nbt);
|
||||||
return nbt;
|
return nbt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ public class BlockSnapshot
|
||||||
{
|
{
|
||||||
if (this.replacedBlock == null)
|
if (this.replacedBlock == null)
|
||||||
{
|
{
|
||||||
this.replacedBlock = ForgeRegistries.BLOCKS.getValue(getRegistryName()).func_196257_b(getMeta());
|
this.replacedBlock = ForgeRegistries.BLOCKS.getValue(getRegistryName()).getStateById(getMeta());
|
||||||
}
|
}
|
||||||
return this.replacedBlock;
|
return this.replacedBlock;
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ public class BlockSnapshot
|
||||||
@Nullable
|
@Nullable
|
||||||
public TileEntity getTileEntity()
|
public TileEntity getTileEntity()
|
||||||
{
|
{
|
||||||
return getNbt() != null ? TileEntity.func_203403_c(getNbt()) : null;
|
return getNbt() != null ? TileEntity.create(getNbt()) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean restore()
|
public boolean restore()
|
||||||
|
@ -202,7 +202,7 @@ public class BlockSnapshot
|
||||||
te = world.getTileEntity(pos);
|
te = world.getTileEntity(pos);
|
||||||
if (te != null)
|
if (te != null)
|
||||||
{
|
{
|
||||||
te.readFromNBT(getNbt());
|
te.read(getNbt());
|
||||||
te.markDirty();
|
te.markDirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -218,12 +218,12 @@ public class BlockSnapshot
|
||||||
{
|
{
|
||||||
compound.setString("blockMod", getRegistryName().getNamespace());
|
compound.setString("blockMod", getRegistryName().getNamespace());
|
||||||
compound.setString("blockName", getRegistryName().getPath());
|
compound.setString("blockName", getRegistryName().getPath());
|
||||||
compound.setInteger("posX", getPos().getX());
|
compound.setInt("posX", getPos().getX());
|
||||||
compound.setInteger("posY", getPos().getY());
|
compound.setInt("posY", getPos().getY());
|
||||||
compound.setInteger("posZ", getPos().getZ());
|
compound.setInt("posZ", getPos().getZ());
|
||||||
compound.setInteger("flag", getFlag());
|
compound.setInt("flag", getFlag());
|
||||||
compound.setInteger("dimension", getDimId());
|
compound.setInt("dimension", getDimId());
|
||||||
compound.setInteger("metadata", getMeta());
|
compound.setInt("metadata", getMeta());
|
||||||
|
|
||||||
compound.setBoolean("hasTE", getNbt() != null);
|
compound.setBoolean("hasTE", getNbt() != null);
|
||||||
|
|
||||||
|
|
|
@ -77,4 +77,4 @@ public class ChunkCoordComparator implements java.util.Comparator<ChunkPos>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class Constants
|
||||||
* NBT Tag type IDS, used when storing the nbt to disc, Should align with NBTBase.getId,
|
* NBT Tag type IDS, used when storing the nbt to disc, Should align with NBTBase.getId,
|
||||||
* table used in NBTBase.func_150283_g
|
* table used in NBTBase.func_150283_g
|
||||||
*
|
*
|
||||||
* Main use is checking tag type in NBTTagCompound.func_150297_b(String, int)
|
* Main use is checking tag type in NBTTagCompound.contains(String, int)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static class NBT
|
public static class NBT
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class FakePlayer extends EntityPlayerMP
|
||||||
{
|
{
|
||||||
public FakePlayer(WorldServer world, GameProfile name)
|
public FakePlayer(WorldServer world, GameProfile name)
|
||||||
{
|
{
|
||||||
super(world.getMinecraftServer(), world, name, new PlayerInteractionManager(world));
|
super(world.getServer(), world, name, new PlayerInteractionManager(world));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public Vec3d getPositionVector(){ return new Vec3d(0, 0, 0); }
|
@Override public Vec3d getPositionVector(){ return new Vec3d(0, 0, 0); }
|
||||||
|
@ -46,10 +46,10 @@ public class FakePlayer extends EntityPlayerMP
|
||||||
@Override public void sendMessage(ITextComponent component) {}
|
@Override public void sendMessage(ITextComponent component) {}
|
||||||
@Override public void addStat(StatBase par1StatBase, int par2){}
|
@Override public void addStat(StatBase par1StatBase, int par2){}
|
||||||
//@Override public void openGui(Object mod, int modGuiId, World world, int x, int y, int z){}
|
//@Override public void openGui(Object mod, int modGuiId, World world, int x, int y, int z){}
|
||||||
@Override public boolean isEntityInvulnerable(DamageSource source){ return true; }
|
@Override public boolean isInvulnerableTo(DamageSource source){ return true; }
|
||||||
@Override public boolean canAttackPlayer(EntityPlayer player){ return false; }
|
@Override public boolean canAttackPlayer(EntityPlayer player){ return false; }
|
||||||
@Override public void onDeath(DamageSource source){ return; }
|
@Override public void onDeath(DamageSource source){ return; }
|
||||||
@Override public void onUpdate(){ return; }
|
@Override public void tick(){ return; }
|
||||||
@Override public Entity changeDimension(int dim, ITeleporter teleporter){ return this; }
|
@Override public Entity changeDimension(int dim, ITeleporter teleporter){ return this; }
|
||||||
@Override public void handleClientSettings(CPacketClientSettings pkt){ return; }
|
@Override public void handleClientSettings(CPacketClientSettings pkt){ return; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class PacketUtil
|
||||||
|
|
||||||
if (stack.getItem().isDamageable() || stack.getItem().getShareTag())
|
if (stack.getItem().isDamageable() || stack.getItem().getShareTag())
|
||||||
{
|
{
|
||||||
nbttagcompound = stack.getTagCompound();
|
nbttagcompound = stack.getTag();
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer.writeCompoundTag(nbttagcompound);
|
buffer.writeCompoundTag(nbttagcompound);
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class WorldCapabilityData extends WorldSavedData
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFromNBT(NBTTagCompound nbt)
|
public void read(NBTTagCompound nbt)
|
||||||
{
|
{
|
||||||
this.capNBT = nbt;
|
this.capNBT = nbt;
|
||||||
if (serializable != null)
|
if (serializable != null)
|
||||||
|
@ -55,7 +55,7 @@ public class WorldCapabilityData extends WorldSavedData
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound writeToNBT(NBTTagCompound nbt)
|
public NBTTagCompound write(NBTTagCompound nbt)
|
||||||
{
|
{
|
||||||
if (serializable != null)
|
if (serializable != null)
|
||||||
nbt = serializable.serializeNBT();
|
nbt = serializable.serializeNBT();
|
||||||
|
|
|
@ -57,4 +57,4 @@ public class DifficultyChangeEvent extends net.minecraftforge.eventbus.api.Event
|
||||||
{
|
{
|
||||||
return oldDifficulty;
|
return oldDifficulty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -384,7 +384,7 @@ public class ForgeEventFactory
|
||||||
|
|
||||||
if (event.getResult() == Result.ALLOW)
|
if (event.getResult() == Result.ALLOW)
|
||||||
{
|
{
|
||||||
if (player.capabilities.isCreativeMode)
|
if (player.abilities.isCreativeMode)
|
||||||
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
|
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
|
||||||
|
|
||||||
stack.shrink(1);
|
stack.shrink(1);
|
||||||
|
@ -499,7 +499,7 @@ public class ForgeEventFactory
|
||||||
{
|
{
|
||||||
Entity e = itr.next();
|
Entity e = itr.next();
|
||||||
double dist = e.getDistance(p.xCoord, p.yCoord, p.zCoord) / diameter;
|
double dist = e.getDistance(p.xCoord, p.yCoord, p.zCoord) / diameter;
|
||||||
if (e.func_180427_aV() || dist > 1.0F) itr.remove();
|
if (e.isImmuneToExplosions() || dist > 1.0F) itr.remove();
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
MinecraftForge.EVENT_BUS.post(new ExplosionEvent.Detonate(world, explosion, list));
|
MinecraftForge.EVENT_BUS.post(new ExplosionEvent.Detonate(world, explosion, list));
|
||||||
|
|
|
@ -51,4 +51,4 @@ public class EntityTravelToDimensionEvent extends EntityEvent
|
||||||
{
|
{
|
||||||
return dimension;
|
return dimension;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,4 +50,4 @@ public class ItemEvent extends EntityEvent
|
||||||
{
|
{
|
||||||
return entityItem;
|
return entityItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,4 +55,4 @@ public class ItemExpireEvent extends ItemEvent
|
||||||
{
|
{
|
||||||
this.extraLife = extraLife;
|
this.extraLife = extraLife;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,4 +54,4 @@ public class ItemTossEvent extends ItemEvent
|
||||||
{
|
{
|
||||||
return player;
|
return player;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,4 +58,4 @@ public class LivingHealEvent extends LivingEvent
|
||||||
{
|
{
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,4 +92,4 @@ public class LivingKnockBackEvent extends LivingEvent
|
||||||
public void setRatioX(double ratioX) {this.ratioX = ratioX;}
|
public void setRatioX(double ratioX) {this.ratioX = ratioX;}
|
||||||
|
|
||||||
public void setRatioZ(double ratioZ) {this.ratioZ = ratioZ;}
|
public void setRatioZ(double ratioZ) {this.ratioZ = ratioZ;}
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue