Update mappings to 09/21 snapshots.

Conflict with getMatrix in ITransformation, so renamed to getMatrixVec.
This commit is contained in:
LexManos 2018-09-22 03:40:22 -07:00
parent 5ed03945a0
commit 94e1a8e0a4
210 changed files with 1052 additions and 978 deletions

View File

@ -36,7 +36,7 @@ project(':clean') {
patcher {
parent = project(':mcp')
patchedSrc = file('src/main/java')
mappings channel: 'snapshot', version: '20180813-1.12'
mappings channel: 'snapshot', version: '20180921-1.13'
mcVersion = '1.13'
}
task runclient(type: JavaExec) {

View File

@ -20,6 +20,15 @@
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")) {
@@ -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 @@
s = s + ("release".equalsIgnoreCase(this.field_146297_k.func_184123_d()) ? "" : "/" + this.field_146297_k.func_184123_d());
}

View File

@ -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_) {
+ 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;
if (p_199332_8_) {
- 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_) {
+ 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_) {
int[] aint = new int[28];
@ -50,7 +50,7 @@
- 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_);
+ }
+
+
+ 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_);
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_) {
+ 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_) {
if (p_199335_4_ == ModelRotation.X0_Y0) {
return p_199335_3_;
} 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));
- 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_);
}
}

View File

@ -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_) {
- return this.func_209565_a(this, p_209558_1_, p_209558_2_, p_209558_3_, p_209558_4_);
+ @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)) {
+ 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_, 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();
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_, 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) {
return new BuiltInModel(this.func_181682_g(), this.func_209568_a(p_209565_1_, p_209565_2_, p_209565_3_));
} else {
@ -60,11 +60,11 @@
TextureAtlasSprite textureatlassprite1 = p_209565_3_.apply(new ResourceLocation(this.func_178308_c(blockpartface.field_178242_d)));
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(makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, state, uvlock));
+ simplebakedmodel$builder.func_177648_a(makeBakedQuad(blockpart, blockpartface, textureatlassprite1, enumfacing, p_209565_4_, p_209565_5_));
} 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(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_);
}
+ 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);
+ 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);
+ }
+
public boolean func_178300_b(String p_178300_1_) {

View File

@ -16,9 +16,9 @@
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)));
}
+
+
+ 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 int rotate(EnumFacing facing, int vertexIndex) { return func_177520_a(facing, vertexIndex); }
}

View File

@ -68,7 +68,7 @@
}
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();
BlockPos blockpos = p_196084_1_.func_195995_a();
BlockWorldState blockworldstate = new BlockWorldState(p_196084_1_.func_195991_k(), blockpos, false);

View File

@ -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));
}

View File

@ -65,7 +65,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
private static final boolean WIREFRAME = false;
// 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 int displayList = -1;
@ -81,7 +81,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
public CloudRenderer()
{
// Resource manager should always be reloadable.
((IReloadableResourceManager) mc.func_195551_G()).func_199006_a(this);
((IReloadableResourceManager) mc.getResourceManager()).addReloadListener(this);
}
private int getScale()
@ -243,7 +243,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
if (OpenGlHelper.useVbo())
vbo = new VertexBuffer(FORMAT);
else
GlStateManager.glNewList(displayList = GLAllocation.generateDisplayLists(1), GL11.GL_COMPILE);
GlStateManager.newList(displayList = GLAllocation.generateDisplayLists(1), GL11.GL_COMPILE);
vertices(buffer);
@ -256,7 +256,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
else
{
tess.draw();
GlStateManager.glEndList();
GlStateManager.endList();
}
}
@ -275,7 +275,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
boolean newEnabled = ForgeMod.forgeCloudsEnabled
&& mc.gameSettings.shouldRenderClouds() != 0
&& mc.world != null
&& mc.world.provider.isSurfaceWorld();
&& mc.world.dimension.isSurfaceWorld();
if (isBuilt()
&& (!newEnabled
@ -305,7 +305,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
double x = entity.prevPosX + (entity.posX - entity.prevPosX) * partialTicks
+ totalOffset * 0.03;
double y = mc.world.provider.getCloudHeight()
double y = mc.world.dimension.getCloudHeight()
- (entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks)
+ 0.33;
double z = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * partialTicks;
@ -322,7 +322,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
GlStateManager.pushMatrix();
// 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.
offU = offU % texW;
@ -330,13 +330,13 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
// Translate the 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.disableCull();
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(
GlStateManager.blendFuncSeparate(
GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA,
GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
@ -350,19 +350,19 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
COLOR_TEX = new DynamicTexture(1, 1, false);
// 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) (g * 255)) << 8
| (int) (b * 255));
COLOR_TEX.updateDynamicTexture();
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.activeTexture(OpenGlHelper.GL_TEXTURE1);
GlStateManager.bindTexture(COLOR_TEX.getGlTextureId());
GlStateManager.enableTexture2D();
// Bind the clouds texture last so the shader's sampler2D is correct.
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
mc.renderEngine.bindTexture(texture);
GlStateManager.activeTexture(OpenGlHelper.GL_TEXTURE0);
mc.textureManager.bindTexture(texture);
ByteBuffer buffer = Tessellator.getInstance().getBuffer().getByteBuffer();
@ -372,12 +372,12 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
vbo.bindBuffer();
int stride = FORMAT.getSize();
GlStateManager.glVertexPointer(3, GL11.GL_FLOAT, stride, 0);
GlStateManager.glEnableClientState(GL11.GL_VERTEX_ARRAY);
GlStateManager.glTexCoordPointer(2, GL11.GL_FLOAT, stride, 12);
GlStateManager.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
GlStateManager.glColorPointer(4, GL11.GL_UNSIGNED_BYTE, stride, 20);
GlStateManager.glEnableClientState(GL11.GL_COLOR_ARRAY);
GlStateManager.vertexPointer(3, GL11.GL_FLOAT, stride, 0);
GlStateManager.enableClientState(GL11.GL_VERTEX_ARRAY);
GlStateManager.texCoordPointer(2, GL11.GL_FLOAT, stride, 12);
GlStateManager.enableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
GlStateManager.colorPointer(4, GL11.GL_UNSIGNED_BYTE, stride, 20);
GlStateManager.enableClientState(GL11.GL_COLOR_ARRAY);
}
else
{
@ -400,8 +400,8 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
// Wireframe for debug.
if (WIREFRAME)
{
GlStateManager.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE);
GlStateManager.glLineWidth(2.0F);
GlStateManager.polygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE);
GlStateManager.lineWidth(2.0F);
GlStateManager.disableTexture2D();
GlStateManager.depthMask(false);
GlStateManager.disableFog();
@ -409,7 +409,7 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
vbo.drawArrays(GL11.GL_QUADS);
else
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.enableTexture2D();
GlStateManager.enableFog();
@ -431,9 +431,9 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
buffer.position(0);
// Disable our coloring.
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.activeTexture(OpenGlHelper.GL_TEXTURE1);
GlStateManager.disableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.activeTexture(OpenGlHelper.GL_TEXTURE0);
// Reset texture matrix.
GlStateManager.matrixMode(GL11.GL_TEXTURE);
@ -450,9 +450,9 @@ public class CloudRenderer implements ISelectiveResourceReloadListener
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);
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)
{
IRenderHandler renderer = world.provider.getCloudRenderer();
IRenderHandler renderer = world.dimension.getCloudRenderer();
if (renderer != null)
{
renderer.render(partialTicks, world, client);

View File

@ -45,7 +45,7 @@ public class ForgeClientHandler
{
if (FluidRegistry.isUniversalBucketEnabled())
{
event.getItemColors().func_199877_a(new FluidContainerColorer(), ForgeMod.getInstance().universalBucket);
event.getItemColors().register(new FluidContainerColorer(), ForgeMod.getInstance().universalBucket);
}
}
}

View File

@ -266,7 +266,7 @@ public class ForgeHooksClient
}
skyInit = true;
GameSettings settings = Minecraft.getMinecraft().gameSettings;
GameSettings settings = Minecraft.getInstance().gameSettings;
int[] ranges = ForgeMod.blendRanges;
int distance = 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)
{
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));
}
@ -389,18 +389,18 @@ public class ForgeHooksClient
m.setIdentity();
m.setTranslation(TRSRTransformation.toVecmath(transform.translation));
t.setIdentity();
t.rotY(transform.rotation.func_195900_b());
t.rotY(transform.rotation.getY());
m.mul(t);
t.setIdentity();
t.rotX(transform.rotation.func_195899_a());
t.rotX(transform.rotation.getX());
m.mul(t);
t.setIdentity();
t.rotZ(transform.rotation.func_195902_c());
t.rotZ(transform.rotation.getZ());
m.mul(t);
t.setIdentity();
t.m00 = transform.scale.func_195899_a();
t.m11 = transform.scale.func_195900_b();
t.m22 = transform.scale.func_195902_c();
t.m00 = transform.scale.getX();
t.m11 = transform.scale.getY();
t.m22 = transform.scale.getZ();
m.mul(t);
return m;
}
@ -471,10 +471,10 @@ public class ForgeHooksClient
glEnableClientState(GL_COLOR_ARRAY);
break;
case UV:
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + attr.getIndex());
OpenGlHelper.glClientActiveTexture(OpenGlHelper.GL_TEXTURE0 + attr.getIndex());
glTexCoordPointer(count, constant, stride, buffer);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
OpenGlHelper.glClientActiveTexture(OpenGlHelper.GL_TEXTURE0);
break;
case PADDING:
break;
@ -503,9 +503,9 @@ public class ForgeHooksClient
GlStateManager.resetColor();
break;
case UV:
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + attr.getIndex());
OpenGlHelper.glClientActiveTexture(OpenGlHelper.GL_TEXTURE0 + attr.getIndex());
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
OpenGlHelper.glClientActiveTexture(OpenGlHelper.GL_TEXTURE0);
break;
case PADDING:
break;
@ -518,15 +518,15 @@ public class ForgeHooksClient
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);
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)
{
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.m03 = tmp.m13 = tmp.m23 = .5f;
ret.mul(tmp, ret);
@ -570,7 +570,7 @@ public class ForgeHooksClient
TileEntityRenderer<?> r = TileEntityRendererDispatcher.instance.getRenderer(tileClass);
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)
{
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;
@ -675,8 +675,8 @@ public class ForgeHooksClient
public static BlockFaceUV applyUVLock(BlockFaceUV blockFaceUV, EnumFacing originalSide, ITransformation rotation)
{
TRSRTransformation global = new TRSRTransformation(rotation.getMatrix());
Matrix4f uv = global.getUVLockTransform(originalSide).getMatrix();
TRSRTransformation global = new TRSRTransformation(rotation.getMatrixVec());
Matrix4f uv = global.getUVLockTransform(originalSide).getMatrixVec();
Vector4f vec = new Vector4f(0, 0, 0, 1);
float u0 = blockFaceUV.getVertexU(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));
Matrix4f mat = null;
if(!tr.equals(TRSRTransformation.identity())) mat = tr.getMatrix();
if(!tr.equals(TRSRTransformation.identity())) mat = tr.getMatrixVec();
return Pair.of(model, mat);
}

View File

@ -106,9 +106,9 @@ public class GuiIngameForge extends GuiIngame
@Override
public void renderGameOverlay(float partialTicks)
{
this.field_194811_H = this.mc.field_195558_d.func_198107_o();
this.field_194812_I = this.mc.field_195558_d.func_198087_p();
eventParent = new RenderGameOverlayEvent(partialTicks, this.mc.field_195558_d);
this.scaledWidth = this.mc.mainWindow.getScaledWidth();
this.scaledHeight = this.mc.mainWindow.getScaledHeight();
eventParent = new RenderGameOverlayEvent(partialTicks, this.mc.mainWindow);
renderHealthMount = mc.player.getRidingEntity() instanceof EntityLivingBase;
renderFood = mc.player.getRidingEntity() == null;
renderJumpBar = mc.player.isRidingHorse();
@ -124,71 +124,71 @@ public class GuiIngameForge extends GuiIngame
if (renderVignette && Minecraft.isFancyGraphicsEnabled())
{
func_194800_d(mc.player.getBrightness());
renderVignette(mc.player.getBrightness());
}
else
{
GlStateManager.enableDepth();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.enableDepthTest();
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
}
if (renderHelmet) renderHelmet(partialTicks);
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) {
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.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();
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 (renderHealth) renderHealth(this.field_194811_H, this.field_194812_I);
if (renderArmor) renderArmor(this.field_194811_H, this.field_194812_I);
if (renderFood) renderFood(this.field_194811_H, this.field_194812_I);
if (renderHealthMount) renderHealthMount(this.field_194811_H, this.field_194812_I);
if (renderAir) renderAir(this.field_194811_H, this.field_194812_I);
if (renderHealth) renderHealth(this.scaledWidth, this.scaledHeight);
if (renderArmor) renderArmor(this.scaledWidth, this.scaledHeight);
if (renderFood) renderFood(this.scaledWidth, this.scaledHeight);
if (renderHealthMount) renderHealthMount(this.scaledWidth, this.scaledHeight);
if (renderAir) renderAir(this.scaledWidth, this.scaledHeight);
}
if (renderJumpBar)
{
func_194803_a(this.field_194811_H / 2 - 91);
renderHorseJumpBar(this.scaledWidth / 2 - 91);
}
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) {
this.func_194801_c();
this.renderSelectedItem();
} 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();
func_194809_b();
renderPotionEffects();
if (!mc.gameSettings.hideGUI) {
renderRecordOverlay(this.field_194811_H, this.field_194812_I, partialTicks);
renderRecordOverlay(this.scaledWidth, this.scaledHeight, partialTicks);
renderSubtitles();
renderTitle(this.field_194811_H, this.field_194812_I, partialTicks);
renderTitle(this.scaledWidth, this.scaledHeight, partialTicks);
}
Scoreboard scoreboard = this.mc.world.getScoreboard();
ScoreObjective objective = null;
ScorePlayerTeam scoreplayerteam = scoreboard.getPlayersTeam(mc.player.func_195047_I_());
ScorePlayerTeam scoreplayerteam = scoreboard.getPlayersTeam(mc.player.getScoreboardName());
if (scoreplayerteam != null)
{
int slot = scoreplayerteam.getColor().getColorIndex();
@ -197,46 +197,46 @@ public class GuiIngameForge extends GuiIngame
ScoreObjective scoreobjective1 = objective != null ? objective : scoreboard.getObjectiveInDisplaySlot(1);
if (renderObjective && scoreobjective1 != null)
{
this.func_194802_a(scoreobjective1);
this.renderScoreboard(scoreobjective1);
}
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
GlStateManager.disableAlpha();
GlStateManager.blendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
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.enableAlpha();
GlStateManager.enableAlphaTest();
post(ALL);
}
@Override
protected void func_194798_c(float partialTicks)
protected void renderAttackIndicator(float partialTicks)
{
if (pre(CROSSHAIRS)) return;
bind(Gui.ICONS);
GlStateManager.enableBlend();
super.func_194798_c(partialTicks);
super.renderAttackIndicator(partialTicks);
post(CROSSHAIRS);
}
@Override
protected void func_194809_b()
protected void renderPotionEffects()
{
if (pre(POTION_ICONS)) return;
super.func_194809_b();
super.renderPotionEffects();
post(POTION_ICONS);
}
protected void renderSubtitles()
{
if (pre(SUBTITLES)) return;
this.overlaySubtitle.func_195620_a();
this.overlaySubtitle.render();
post(SUBTITLES);
}
@ -245,7 +245,7 @@ public class GuiIngameForge extends GuiIngame
{
if (pre(BOSSHEALTH)) return;
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");
GlStateManager.enableBlend();
this.overlayBoss.renderBossHealth();
@ -255,16 +255,16 @@ public class GuiIngameForge extends GuiIngame
}
@Override
protected void func_194800_d(float lightLevel)
protected void renderVignette(float lightLevel)
{
if (pre(VIGNETTE))
{
// Need to put this here, since Vanilla assumes this state after the vignette was rendered.
GlStateManager.enableDepth();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.enableDepthTest();
GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
return;
}
super.func_194800_d(lightLevel);
super.renderVignette(lightLevel);
post(VIGNETTE);
}
@ -277,13 +277,13 @@ public class GuiIngameForge extends GuiIngame
if (this.mc.gameSettings.thirdPersonView == 0 && !itemstack.isEmpty())
{
Item item = itemstack.getItem();
if (item == Blocks.field_196625_cS.func_199767_j())
if (item == Blocks.CARVED_PUMPKIN.asItem())
{
func_194808_p();
renderPumpkinOverlay();
}
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
protected void func_194805_e(float partialTicks)
protected void renderPortal(float partialTicks)
{
if (pre(PORTAL)) return;
@ -332,24 +332,24 @@ public class GuiIngameForge extends GuiIngame
if (f1 > 0.0F)
{
super.func_194805_e(f1);
super.renderPortal(f1);
}
post(PORTAL);
}
@Override
protected void func_194806_b(float partialTicks)
protected void renderHotbar(float partialTicks)
{
if (pre(HOTBAR)) return;
if (mc.playerController.getCurrentGameType() == GameType.SPECTATOR)
{
this.spectatorGui.func_195622_a(partialTicks);
this.spectatorGui.renderTooltip(partialTicks);
}
else
{
super.func_194806_b(partialTicks);
super.renderHotbar(partialTicks);
}
post(HOTBAR);
@ -371,7 +371,7 @@ public class GuiIngameForge extends GuiIngame
int top = height - right_height;
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 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();
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)
{
this.lastSystemTime = Util.func_211177_b();
this.healthUpdateCounter = (long)(this.updateCounter + 20);
this.lastSystemTime = Util.milliTime();
this.healthUpdateCounter = (long)(this.ticks + 20);
}
else if (health > this.playerHealth && player.hurtResistantTime > 0)
{
this.lastSystemTime = Util.func_211177_b();
this.healthUpdateCounter = (long)(this.updateCounter + 10);
this.lastSystemTime = Util.milliTime();
this.healthUpdateCounter = (long)(this.ticks + 10);
}
if (Util.func_211177_b() - this.lastSystemTime > 1000L)
if (Util.milliTime() - this.lastSystemTime > 1000L)
{
this.playerHealth = health;
this.lastPlayerHealth = health;
this.lastSystemTime = Util.func_211177_b();
this.lastSystemTime = Util.milliTime();
}
this.playerHealth = health;
int healthLast = this.lastPlayerHealth;
IAttributeInstance attrMaxHealth = player.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH);
float healthMax = (float)attrMaxHealth.getAttributeValue();
IAttributeInstance attrMaxHealth = player.getAttribute(SharedMonsterAttributes.MAX_HEALTH);
float healthMax = (float)attrMaxHealth.getValue();
float absorb = MathHelper.ceil(player.getAbsorptionAmount());
int healthRows = MathHelper.ceil((healthMax + absorb) / 2.0F / 10.0F);
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 top = height - left_height;
@ -437,10 +437,10 @@ public class GuiIngameForge extends GuiIngame
int regen = -1;
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);
int MARGIN = 16;
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 (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);
}
@ -546,8 +546,8 @@ public class GuiIngameForge extends GuiIngame
if (mc.player.getSleepTimer() > 0)
{
mc.profiler.startSection("sleep");
GlStateManager.disableDepth();
GlStateManager.disableAlpha();
GlStateManager.disableDepthTest();
GlStateManager.disableAlphaTest();
int sleepTime = mc.player.getSleepTimer();
float opacity = (float)sleepTime / 100.0F;
@ -558,8 +558,8 @@ public class GuiIngameForge extends GuiIngame
int color = (int)(220.0F * opacity) << 24 | 1052704;
drawRect(0, 0, width, height, color);
GlStateManager.enableAlpha();
GlStateManager.enableDepth();
GlStateManager.enableAlphaTest();
GlStateManager.enableDepthTest();
mc.profiler.endSection();
}
}
@ -568,28 +568,28 @@ public class GuiIngameForge extends GuiIngame
{
bind(ICONS);
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();
if (mc.playerController.gameIsSurvivalOrAdventure())
{
super.func_194804_b(x);
super.renderExpBar(x);
}
GlStateManager.enableBlend();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.color4f(1.0F, 1.0F, 1.0F, 1.0F);
post(EXPERIENCE);
}
@Override
public void func_194803_a(int x)
public void renderHorseJumpBar(int x)
{
bind(ICONS);
if (pre(JUMPBAR)) return;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableBlend();
super.func_194803_a(x);
super.renderHorseJumpBar(x);
GlStateManager.enableBlend();
mc.profiler.endSection();
@ -601,13 +601,13 @@ public class GuiIngameForge extends GuiIngame
protected void renderHUDText(int width, int height)
{
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> listR = new ArrayList<String>();
if (mc.isDemo())
{
long time = mc.world.getTotalWorldTime();
long time = mc.world.getGameTime();
if (time >= 120500L)
{
listR.add(I18n.format("demo.demoExpired"));
@ -674,9 +674,9 @@ public class GuiIngameForge extends GuiIngame
if (opacity > 0)
{
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.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);
fontrenderer.drawStringWithShadow(overlayMessage, -fontrenderer.getStringWidth(overlayMessage) / 2, -4, color | (opacity << 24));
GlStateManager.disableBlend();
@ -707,16 +707,16 @@ public class GuiIngameForge extends GuiIngame
if (opacity > 8)
{
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.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.scale(4.0F, 4.0F, 4.0F);
GlStateManager.scalef(4.0F, 4.0F, 4.0F);
int l = opacity << 24 & -16777216;
this.getFontRenderer().drawStringWithShadow(this.displayedTitle, (float)(-this.getFontRenderer().getStringWidth(this.displayedTitle) / 2), -10.0F, 16777215 | l);
GlStateManager.popMatrix();
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);
GlStateManager.popMatrix();
GlStateManager.disableBlend();
@ -735,8 +735,8 @@ public class GuiIngameForge extends GuiIngame
if (MinecraftForge.EVENT_BUS.post(event)) return;
GlStateManager.pushMatrix();
GlStateManager.translate((float) event.getPosX(), (float) event.getPosY(), 0.0F);
persistantChatGUI.drawChat(updateCounter);
GlStateManager.translatef((float) event.getPosX(), (float) event.getPosY(), 0.0F);
persistantChatGUI.drawChat(ticks);
GlStateManager.popMatrix();
post(CHAT);
@ -751,14 +751,14 @@ public class GuiIngameForge extends GuiIngame
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;
this.overlayPlayerList.renderPlayerlist(width, this.mc.world.getScoreboard(), scoreobjective);
post(PLAYER_LIST);
}
else
{
this.overlayPlayerList.updatePlayerList(false);
this.overlayPlayerList.setVisible(false);
}
}
@ -836,10 +836,10 @@ public class GuiIngameForge extends GuiIngame
this.mc = mc;
}
@Override protected void renderDebugInfoLeft(){}
@Override protected void func_194819_c(){}
@Override protected void renderDebugInfoRight(){}
private List<String> getLeft()
{
List<String> ret = this.func_209011_c();
List<String> ret = this.call();
ret.add("");
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");

View File

@ -50,13 +50,13 @@ public class ItemModelMesherForge extends ItemModelMesher
@Override
@Nullable
public IBakedModel func_199312_b(Item item)
public IBakedModel getItemModel(Item item)
{
return models.get(item.delegate);
}
@Override
public void func_199311_a(Item item, ModelResourceLocation location)
public void register(Item item, ModelResourceLocation location)
{
IRegistryDelegate<Item> key = item.delegate;
locations.put(key, location);

View File

@ -53,7 +53,7 @@ public class MinecraftForgeClient
*/
public static Locale getLocale()
{
return Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getJavaLocale();
return Minecraft.getInstance().getLanguageManager().getCurrentLanguage().getJavaLocale();
}
private static BitSet stencilBits = new BitSet(8);

View File

@ -25,6 +25,8 @@ import net.minecraft.entity.Entity;
import net.minecraftforge.eventbus.api.Cancelable;
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
* the player sees.

View File

@ -44,4 +44,4 @@ public class PlayerSPPushOutOfBlocksEvent extends PlayerEvent
public AxisAlignedBB getEntityBoundingBox() { return entityBoundingBox; }
public void setEntityBoundingBox(@Nonnull AxisAlignedBB entityBoundingBox) { this.entityBoundingBox = entityBoundingBox; }
}
}

View File

@ -135,4 +135,4 @@ public abstract class RenderPlayerEvent extends PlayerEvent
return stack;
}
}
}
}

View File

@ -29,4 +29,4 @@ public class PlaySoundSourceEvent extends SoundSourceEvent
{
super(manager, sound, uuid);
}
}
}

View File

@ -29,4 +29,4 @@ public class PlayStreamingSourceEvent extends SoundSourceEvent
{
super(manager, sound, uuid);
}
}
}

View File

@ -18,12 +18,12 @@ public interface IForgeKeybinding
*/
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()
{
setKeyModifierAndCode(getKeyModifierDefault(), getKeyBinding().func_197977_i());
setKeyModifierAndCode(getKeyModifierDefault(), getKeyBinding().getDefault());
}
void setKeyConflictContext(IKeyConflictContext keyConflictContext);

View File

@ -61,15 +61,15 @@ public class NotificationModUpdateScreen extends GuiScreen
}
@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)
{
return;
}
Minecraft.getMinecraft().getTextureManager().bindTexture(VERSION_CHECK_ICONS);
GlStateManager.color(1, 1, 1, 1);
Minecraft.getInstance().getTextureManager().bindTexture(VERSION_CHECK_ICONS);
GlStateManager.color4f(1, 1, 1, 1);
GlStateManager.pushMatrix();
int x = modButton.x;

View File

@ -67,7 +67,7 @@ public class BakedItemModel implements IBakedModel
@Override public ItemOverrideList getOverrides() { return overrides; }
@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)
{
@ -105,7 +105,7 @@ public class BakedItemModel implements IBakedModel
}
@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)
{

View File

@ -43,9 +43,9 @@ public abstract class BakedModelWrapper<T extends IBakedModel> implements IBaked
}
@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

View File

@ -68,9 +68,9 @@ final class FancyMissingModel implements IUnbakedModel
m.m33 = 1;
m.setTranslation(new Vector3f(1, 1 + 1f / 0x100, 0));
return new SimpleModelFontRenderer(
Minecraft.getMinecraft().gameSettings,
Minecraft.getInstance().gameSettings,
font,
Minecraft.getMinecraft().getTextureManager(),
Minecraft.getInstance().getTextureManager(),
false,
m,
format
@ -92,15 +92,15 @@ final class FancyMissingModel implements IUnbakedModel
this.missingModel = missingModel;
this.message = message;
}
@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);
}
@Override
public Collection<ResourceLocation> getOverrideLocations()
public Collection<ResourceLocation> getOverrideLocations()
{
return Collections.emptyList();
}
@ -145,7 +145,7 @@ final class FancyMissingModel implements IUnbakedModel
}
@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)
{
@ -161,16 +161,16 @@ final class FancyMissingModel implements IUnbakedModel
}
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();
builder.addAll(missingModel.func_200117_a (state, side, rand));
builder.addAll(missingModel.getQuads (state, side, rand));
builder.addAll(fontRenderer.build());
quads = builder.build();
}
return quads;
}
return missingModel.func_200117_a (state, side, rand);
return missingModel.getQuads (state, side, rand);
}
@Override
@ -186,7 +186,7 @@ final class FancyMissingModel implements IUnbakedModel
public TextureAtlasSprite getParticleTexture() { return fontTexture; }
@Override
public ItemOverrideList getOverrides() { return ItemOverrideList.NONE; }
public ItemOverrideList getOverrides() { return ItemOverrideList.EMPTY; }
@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType)
@ -230,9 +230,9 @@ final class FancyMissingModel implements IUnbakedModel
}
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());
}
}
}

View File

@ -31,14 +31,14 @@ import net.minecraft.util.ResourceLocation;
public interface ICustomModelLoader extends ISelectiveResourceReloadListener
{
@Override
void func_195410_a(IResourceManager resourceManager);
void onResourceManagerReload(IResourceManager resourceManager);
@Override
default void onResourceManagerReload(IResourceManager resourceManager, Predicate<IResourceType> resourcePredicate)
{
if (resourcePredicate.test(VanillaResourceType.MODELS))
{
func_195410_a(resourceManager);
onResourceManagerReload(resourceManager);
}
}

View File

@ -43,7 +43,7 @@ import net.minecraftforge.common.model.animation.IClip;
public interface IModel<T extends IModel<T>>
{
@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.

View File

@ -64,7 +64,7 @@ public final class ItemLayerModel implements IUnbakedModel
public ItemLayerModel(ImmutableList<ResourceLocation> textures)
{
this(textures, ItemOverrideList.NONE);
this(textures, ItemOverrideList.EMPTY);
}
public ItemLayerModel(ImmutableList<ResourceLocation> textures, ItemOverrideList overrides)
@ -75,7 +75,7 @@ public final class ItemLayerModel implements IUnbakedModel
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)
@ -87,17 +87,17 @@ public final class ItemLayerModel implements IUnbakedModel
}
return builder.build();
}
@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;
}
@Override
public Collection<ResourceLocation> getOverrideLocations()
public Collection<ResourceLocation> getOverrideLocations()
{
return Collections.emptyList();
return Collections.emptyList();
}
@Override
@ -117,9 +117,9 @@ public final class ItemLayerModel implements IUnbakedModel
}
return new ItemLayerModel(builder.build(), overrides);
}
@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();
Optional<TRSRTransformation> transform = state.apply(Optional.empty());
for(int i = 0; i < textures.size(); i++)
@ -136,8 +136,8 @@ public final class ItemLayerModel implements IUnbakedModel
{
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
int uMax = sprite.getIconWidth();
int vMax = sprite.getIconHeight();
int uMax = sprite.getWidth();
int vMax = sprite.getHeight();
FaceData faceData = new FaceData(uMax, vMax);
boolean translucent = false;
@ -343,8 +343,8 @@ public final class ItemLayerModel implements IUnbakedModel
{
final float eps = 1e-2f;
int width = sprite.getIconWidth();
int height = sprite.getIconHeight();
int width = sprite.getWidth();
int height = sprite.getHeight();
float x0 = (float) u / width;
float y0 = (float) v / height;
@ -424,7 +424,7 @@ public final class ItemLayerModel implements IUnbakedModel
vec.y = y;
vec.z = z;
vec.w = 1;
transform.get().getMatrix().transform(vec);
transform.get().getMatrixVec().transform(vec);
builder.put(e, vec.x, vec.y, vec.z, vec.w);
}
else
@ -455,7 +455,7 @@ public final class ItemLayerModel implements IUnbakedModel
INSTANCE;
@Override
public void func_195410_a(IResourceManager resourceManager) {}
public void onResourceManagerReload(IResourceManager resourceManager) {}
@Override
public boolean accepts(ResourceLocation modelLocation)

View File

@ -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)
{
int w = template.getIconWidth();
int h = template.getIconHeight();
int w = template.getWidth();
int h = template.getHeight();
float wScale = 16f / (float)w;
float hScale = 16f / (float)h;
List<UnpackedBakedQuad> quads = Lists.newArrayList();
@ -93,7 +93,7 @@ public final class ItemTextureQuadConverter
for (int x = 0; x < w; x++)
{
// 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
if (start < 0 && isVisible)
@ -111,7 +111,7 @@ public final class ItemTextureQuadConverter
{
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;
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)
{
int w = template.getIconWidth();
int h = template.getIconHeight();
int w = template.getWidth();
int h = template.getHeight();
float wScale = 16f / (float)w;
float hScale = 16f / (float)h;
List<UnpackedBakedQuad> quads = Lists.newArrayList();
@ -171,7 +171,7 @@ public final class ItemTextureQuadConverter
for (int y = 0; y < h; y++)
{
// 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
if (start < 0 && isVisible)
@ -189,7 +189,7 @@ public final class ItemTextureQuadConverter
{
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;
break;
@ -305,7 +305,7 @@ public final class ItemTextureQuadConverter
vec.y = y;
vec.z = z;
vec.w = 1;
transform.getMatrix().transform(vec);
transform.getMatrixVec().transform(vec);
builder.put(e, vec.x, vec.y, vec.z, vec.w);
}
break;

View File

@ -111,7 +111,7 @@ public final class ModelDynBucket implements IUnbakedModel
}
@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();
@ -160,7 +160,7 @@ public final class ModelDynBucket implements IUnbakedModel
// build base (insidest)
IBakedModel model = (new ItemLayerModel(ImmutableList.of(baseLocation))).bake(modelGetter, bakedTextureGetter, state, uvlock, format);
random.setSeed(42);
builder.addAll(model.func_200117_a(null, null, random));
builder.addAll(model.getQuads(null, null, random));
particleSprite = model.getParticleTexture();
}
if (liquidLocation != null && fluidSprite != null)
@ -260,7 +260,7 @@ public final class ModelDynBucket implements IUnbakedModel
{
try
{
return Minecraft.getMinecraft().func_195551_G().func_199002_a(resourceLocation);
return Minecraft.getInstance().getResourceManager().getResource(resourceLocation);
}
catch (IOException ignored)
{
@ -298,7 +298,7 @@ public final class ModelDynBucket implements IUnbakedModel
}
@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
}
@ -331,7 +331,7 @@ public final class ModelDynBucket implements IUnbakedModel
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
@ -373,7 +373,7 @@ public final class ModelDynBucket implements IUnbakedModel
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
@ -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"))
) {
// 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)
{
final int[][] oldPixels = sprite.getFrameTextureData(0);
@ -437,7 +437,7 @@ public final class ModelDynBucket implements IUnbakedModel
private BakedDynBucketOverrideHandler() {}
@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)
.map(fluidStack -> {
@ -450,7 +450,7 @@ public final class ModelDynBucket implements IUnbakedModel
{
IUnbakedModel parent = model.parent.process(ImmutableMap.of("fluid", name));
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);
model.cache.put(name, bakedModel);

View File

@ -79,13 +79,13 @@ public final class ModelFluid implements IUnbakedModel
}
@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
? ImmutableSet.of(fluid.getStill(), fluid.getFlowing(), fluid.getOverlay())
: ImmutableSet.of(fluid.getStill(), fluid.getFlowing());
}
@Override
public Collection<ResourceLocation> getOverrideLocations() {
return Collections.emptyList();
@ -112,7 +112,7 @@ public final class ModelFluid implements IUnbakedModel
INSTANCE;
@Override
public void func_195410_a(IResourceManager resourceManager) {}
public void onResourceManagerReload(IResourceManager resourceManager) {}
@Override
public boolean accepts(ResourceLocation modelLocation)
@ -229,7 +229,7 @@ public final class ModelFluid implements IUnbakedModel
}
@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)
{
@ -255,10 +255,10 @@ public final class ModelFluid implements IUnbakedModel
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())
{
Vector4f vec = new Vector4f(data);
transformation.get().getMatrix().transform(vec);
transformation.get().getMatrixVec().transform(vec);
vec.get(data);
}
builder.put(e, data);
@ -484,7 +484,7 @@ public final class ModelFluid implements IUnbakedModel
}
@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);
}
@ -492,7 +492,7 @@ public final class ModelFluid implements IUnbakedModel
@Override
public ItemOverrideList getOverrides()
{
return ItemOverrideList.NONE;
return ItemOverrideList.EMPTY;
}
@Override

View File

@ -162,45 +162,45 @@ public final class ModelLoader extends ModelBakery
return bakedRegistry;
isLoading = true;
missingModel = ModelLoaderRegistry.getMissingModel();
stateModels.put(MODEL_MISSING, missingModel);
final Set<ResourceLocation> textures = Sets.newHashSet(ModelLoaderRegistry.getTextures());
textures.remove(MissingTextureSprite.func_195675_b());
textures.remove(MissingTextureSprite.getLocation());
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_) -> {
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()) {
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<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());
set1.addAll(LOCATIONS_BUILTIN_TEXTURES);
set.forEach((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_) -> {
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) {
this.bakedRegistry.putObject(p_209599_1_, ibakedmodel);
}
});
return this.bakedRegistry;
IBakedModel missingBaked = missingModel.bake(defaultModelGetter(), defaultTextureGetter(), missingModel.getDefaultState(), false, DefaultVertexFormats.ITEM);
Map<IUnbakedModel, IBakedModel> bakedModels = Maps.newHashMap();
HashMultimap<IUnbakedModel, ModelResourceLocation> models = HashMultimap.create();
@ -356,8 +356,8 @@ public final class ModelLoader extends ModelBakery
private final class VanillaModelWrapper implements IUnbakedModel
{
private final FaceBakery faceBakery = new FaceBakery();
private final FaceBakery faceBakery = new FaceBakery();
private final ResourceLocation location;
private final ModelBlock model;
private final boolean uvlock;
@ -390,9 +390,9 @@ public final class ModelLoader extends ModelBakery
}
return ImmutableSet.copyOf(set);
}
@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
if(model.getParentLocation() != null)
@ -471,7 +471,7 @@ public final class ModelLoader extends ModelBakery
{
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);
}
@ -479,7 +479,7 @@ public final class ModelLoader extends ModelBakery
{
final TRSRTransformation baseState = modelState.apply(Optional.empty()).orElse(TRSRTransformation.identity());
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++)
{
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)));
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));
}
@ -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());
@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)
{
@ -526,11 +526,11 @@ public final class ModelLoader extends ModelBakery
IExtendedBlockState newExState = (IExtendedBlockState) exState.withProperty(Properties.AnimationProperty, 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
@ -675,7 +675,7 @@ public final class ModelLoader extends ModelBakery
ModelLoaderRegistry.getModelOrMissing(location);
}
//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);
@ -703,15 +703,15 @@ public final class ModelLoader extends ModelBakery
this.models = models;
this.defaultState = defaultState;
}
@Override
public Collection<ResourceLocation> getOverrideLocations()
public Collection<ResourceLocation> getOverrideLocations()
{
return ImmutableList.copyOf(locations);
}
@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);
}
@ -734,7 +734,7 @@ public final class ModelLoader extends ModelBakery
IUnbakedModel model = models.get(i);
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
@ -757,7 +757,7 @@ public final class ModelLoader extends ModelBakery
for(int i = 0; i < this.variants.size(); i++)
{
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);
builder.add(Pair.of(retextured, this.variants.get(i).getState()));
}
@ -850,7 +850,7 @@ public final class ModelLoader extends ModelBakery
// NOOP, handled in loader
@Override
public void func_195410_a(IResourceManager resourceManager) {}
public void onResourceManagerReload(IResourceManager resourceManager) {}
@Override
public boolean accepts(ResourceLocation modelLocation)
@ -887,17 +887,17 @@ public final class ModelLoader extends ModelBakery
return "VanillaLoader.INSTANCE";
}
}
// Temporary to compile things
public static final class White {
public static final ResourceLocation LOCATION = new ResourceLocation("white");
public static final TextureAtlasSprite INSTANCE = MissingTextureSprite.func_195677_a();
public static final ResourceLocation LOCATION = new ResourceLocation("white");
public static final TextureAtlasSprite INSTANCE = MissingTextureSprite.getSprite();
}
/**
* 16x16 pure white sprite.
*/
/*/ TODO Custom TAS
/*/ TODO Custom TAS
public static final class White extends TextureAtlasSprite
{
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)
{
IBakedModel missingModel = modelRegistry.getObject(MODEL_MISSING);
IBakedModel missingModel = modelRegistry.get(MODEL_MISSING);
for(Map.Entry<ResourceLocation, Exception> entry : loadingExceptions.entrySet())
{
// 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()));
final ModelResourceLocation location = (ModelResourceLocation)entry.getKey();
final IBakedModel model = modelRegistry.getObject(location);
final IBakedModel model = modelRegistry.get(location);
if(model == null)
{
modelRegistry.putObject(location, missingModel);
modelRegistry.put(location, missingModel);
}
}
}
for(ModelResourceLocation missing : missingVariants)
{
IBakedModel model = modelRegistry.getObject(missing);
IBakedModel model = modelRegistry.get(missing);
if(model == null || model == missingModel)
{
LOGGER.debug(MODELLOADING, ()-> new ModelLoaderErrorMessage(missing, null));
}
if(model == null)
{
modelRegistry.putObject(missing, missingModel);
modelRegistry.put(missing, missingModel);
}
}
loadingExceptions.clear();
@ -1047,7 +1047,7 @@ public final class ModelLoader extends ModelBakery
{
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
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;
/**
@ -1071,10 +1071,10 @@ public final class ModelLoader extends ModelBakery
{
return DefaultTextureGetter.INSTANCE;
}
public static Function<ResourceLocation, IUnbakedModel> defaultModelGetter()
{
return DEFAULT_MODEL_GETTER;
return DEFAULT_MODEL_GETTER;
}
protected static enum VariantLoader implements ICustomModelLoader
@ -1090,7 +1090,7 @@ public final class ModelLoader extends ModelBakery
// NOOP, handled in loader
@Override
public void func_195410_a(IResourceManager resourceManager) {}
public void onResourceManagerReload(IResourceManager resourceManager) {}
@Override
public boolean accepts(ResourceLocation modelLocation)
@ -1101,7 +1101,7 @@ public final class ModelLoader extends ModelBakery
@Override
public IUnbakedModel loadModel(ResourceLocation modelLocation) throws Exception
{
return loader.func_209597_a(modelLocation);
return loader.getUnbakedModel(modelLocation);
}
@Override

View File

@ -79,7 +79,7 @@ public class ModelLoaderRegistry
public static void registerLoader(ICustomModelLoader 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)
@ -174,7 +174,7 @@ public class ModelLoaderRegistry
{
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
{
@ -237,7 +237,7 @@ public class ModelLoaderRegistry
{
//IModel model = new FancyMissingModel(ExceptionUtils.getStackTrace(cause).replaceAll("\\t", " "));
IUnbakedModel model = new FancyMissingModel(getMissingModel(), location.toString());
textures.addAll(model.func_209559_a(null, null));
textures.addAll(model.getTextures(null, null));
return model;
}

View File

@ -77,7 +77,7 @@ public final class MultiLayerModel implements IUnbakedModel
}
@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();
}
@ -154,7 +154,7 @@ public final class MultiLayerModel implements IUnbakedModel
}
@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();
if (layer == null)
@ -162,12 +162,12 @@ public final class MultiLayerModel implements IUnbakedModel
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
for (IBakedModel model : models.values())
{
builder.addAll(model.func_200117_a(state, side, rand));
builder.addAll(model.getQuads(state, side, rand));
}
return builder.build();
}
// 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
@ -209,7 +209,7 @@ public final class MultiLayerModel implements IUnbakedModel
@Override
public ItemOverrideList getOverrides()
{
return ItemOverrideList.NONE;
return ItemOverrideList.EMPTY;
}
}
@ -218,7 +218,7 @@ public final class MultiLayerModel implements IUnbakedModel
INSTANCE;
@Override
public void func_195410_a(IResourceManager resourceManager) {}
public void onResourceManagerReload(IResourceManager resourceManager) {}
@Override
public boolean accepts(ResourceLocation modelLocation)

View File

@ -63,7 +63,7 @@ import com.google.common.collect.Sets;
public final class MultiModel implements IUnbakedModel
{
private static final Logger LOGGER = LogManager.getLogger();
private static final class Baked implements IBakedModel
{
private final ResourceLocation location;
@ -76,7 +76,7 @@ public final class MultiModel implements IUnbakedModel
private final ItemOverrideList overrides = new ItemOverrideList()
{
@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)
{
@ -87,7 +87,7 @@ public final class MultiModel implements IUnbakedModel
if(base != null)
{
newBase = base.getOverrides().func_209581_a(base, stack, world, entity);
newBase = base.getOverrides().getModelWithOverrides(base, stack, world, entity);
if(base != newBase)
{
dirty = true;
@ -96,7 +96,7 @@ public final class MultiModel implements IUnbakedModel
ImmutableMap.Builder<String, IBakedModel> builder = ImmutableMap.builder();
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);
if(entry.getValue() != newPart)
{
@ -188,16 +188,16 @@ public final class MultiModel implements IUnbakedModel
}
@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();
if (base != null)
{
quads.addAll(base.func_200117_a(state, side, rand));
quads.addAll(base.getQuads(state, side, rand));
}
for (IBakedModel bakedPart : parts.values())
{
quads.addAll(bakedPart.func_200117_a(state, side, rand));
quads.addAll(bakedPart.getQuads(state, side, rand));
}
return quads.build();
}
@ -207,7 +207,7 @@ public final class MultiModel implements IUnbakedModel
{
Pair<Baked, TRSRTransformation> p = transforms.get(cameraTransformType);
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
@ -247,9 +247,9 @@ public final class MultiModel implements IUnbakedModel
{
this(location, base, ImmutableMap.copyOf(parts));
}
@Override
public Collection<ResourceLocation> getOverrideLocations()
public Collection<ResourceLocation> getOverrideLocations()
{
Set<ResourceLocation> deps = Sets.newHashSet();
@ -261,17 +261,17 @@ public final class MultiModel implements IUnbakedModel
return deps;
}
@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();
if (base != null)
deps.addAll(base.func_209559_a(modelGetter, missingTextures));
deps.addAll(base.getTextures(modelGetter, missingTextures));
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;
}

View File

@ -88,7 +88,7 @@ public class PerspectiveMapWrapper implements IBakedModel
TRSRTransformation tr = transforms.getOrDefault(cameraTransformType, TRSRTransformation.identity());
if (!tr.isIdentity())
{
return Pair.of(model, TRSRTransformation.blockCornerToCenter(tr).getMatrix());
return Pair.of(model, TRSRTransformation.blockCornerToCenter(tr).getMatrixVec());
}
return Pair.of(model, null);
}
@ -98,7 +98,7 @@ public class PerspectiveMapWrapper implements IBakedModel
TRSRTransformation tr = state.apply(Optional.of(cameraTransformType)).orElse(TRSRTransformation.identity());
if (!tr.isIdentity())
{
return Pair.of(model, TRSRTransformation.blockCornerToCenter(tr).getMatrix());
return Pair.of(model, TRSRTransformation.blockCornerToCenter(tr).getMatrixVec());
}
return Pair.of(model, null);
}
@ -110,7 +110,7 @@ public class PerspectiveMapWrapper implements IBakedModel
@Override public TextureAtlasSprite getParticleTexture() { return parent.getParticleTexture(); }
@SuppressWarnings("deprecation")
@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

View File

@ -47,10 +47,10 @@ public enum Animation
{
if (worldRef == null || worldRef.get() != world)
{
epochTime = world.getTotalWorldTime();
epochTime = world.getGameTime();
worldRef = new WeakReference<>(world);
}
return (world.getTotalWorldTime() - epochTime + tickProgress) / 20;
return (world.getGameTime() - epochTime + tickProgress) / 20;
}
/**

View File

@ -65,7 +65,7 @@ public final class AnimationItemOverrideList extends ItemOverrideList
}
@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)
.map(asm ->
@ -78,12 +78,12 @@ public final class AnimationItemOverrideList extends ItemOverrideList
}
if(world == null)
{
w = Minecraft.getMinecraft().world;
w = Minecraft.getInstance().world;
}
return asm.apply(Animation.getWorldTime(world, Animation.getPartialTickTime())).getLeft();
})
// TODO where should uvlock data come from?
.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));
}
}

View File

@ -82,7 +82,7 @@ public class AnimationModelBase<T extends Entity> extends ModelBase implements I
RenderHelper.disableStandardItemLighting();
GlStateManager.pushMatrix();
GlStateManager.rotate(180, 0, 0, 1);
GlStateManager.rotatef(180, 0, 0, 1);
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder builder = tessellator.getBuffer();
builder.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
@ -95,7 +95,7 @@ public class AnimationModelBase<T extends Entity> extends ModelBase implements I
boolean empty = true;
Random random = new Random();
random.setSeed(42);
List<BakedQuad> quads = bakedModel.func_200117_a(null, null, random);
List<BakedQuad> quads = bakedModel.getQuads(null, null, random);
if(!quads.isEmpty())
{
lighter.updateBlockInfo();
@ -108,7 +108,7 @@ public class AnimationModelBase<T extends Entity> extends ModelBase implements I
for(EnumFacing side : EnumFacing.values())
{
random.setSeed(42);
quads = bakedModel.func_200117_a(null, side, random);
quads = bakedModel.getQuads(null, side, random);
if(!quads.isEmpty())
{
if(empty) lighter.updateBlockInfo();

View File

@ -56,13 +56,13 @@ public class AnimationTESR<T extends TileEntity> extends FastTESR<T> implements
{
return;
}
if(blockRenderer == null) blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher();
if(blockRenderer == null) blockRenderer = Minecraft.getInstance().getBlockRendererDispatcher();
BlockPos pos = te.getPos();
IWorldReader world = MinecraftForgeClient.getRegionRenderCache(te.getWorld(), 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)
{
@ -76,12 +76,12 @@ public class AnimationTESR<T extends TileEntity> extends FastTESR<T> implements
handleEvents(te, time, pair.getRight());
// 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());
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);
});
}
}

View File

@ -34,7 +34,7 @@ import net.minecraft.tileentity.TileEntity;
public abstract class FastTESR<T extends TileEntity> extends TileEntityRenderer<T>
{
@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();
BufferBuilder buffer = tessellator.getBuffer();

View File

@ -71,8 +71,8 @@ import com.google.gson.annotations.SerializedName;
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, MBClip> clips;
private transient ImmutableMultimap<Integer, MBJointWeight> jointIndexMap;
@ -534,7 +534,7 @@ public class ModelBlockAnimation
if(trOp.isPresent() && !trOp.get().isIdentity())
{
float w = info.getWeights().get(i)[0];
tmp = trOp.get().getMatrix();
tmp = trOp.get().getMatrixVec();
tmp.mul(w);
m.add(tmp);
weight += w;
@ -557,9 +557,9 @@ public class ModelBlockAnimation
{
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);
return mba;
}

View File

@ -98,8 +98,8 @@ import com.google.gson.JsonParser;
public enum B3DLoader implements ICustomModelLoader
{
INSTANCE;
private static final Logger LOGGER = LogManager.getLogger();
private static final Logger LOGGER = LogManager.getLogger();
private IResourceManager manager;
@ -112,7 +112,7 @@ public enum B3DLoader implements ICustomModelLoader
}
@Override
public void func_195410_a(IResourceManager manager)
public void onResourceManagerReload(IResourceManager manager)
{
this.manager = manager;
cache.clear();
@ -136,17 +136,17 @@ public enum B3DLoader implements ICustomModelLoader
{
try
{
resource = manager.func_199002_a(file);
resource = manager.getResource(file);
}
catch(FileNotFoundException e)
{
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/"))
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;
}
B3DModel.Parser parser = new B3DModel.Parser(resource.func_199027_b());
B3DModel.Parser parser = new B3DModel.Parser(resource.getInputStream());
B3DModel model = parser.parse();
cache.put(file, model);
}
@ -365,7 +365,7 @@ public enum B3DLoader implements ICustomModelLoader
@Override
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();
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());
return path;
}
@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("#"));
}
@Override
public Collection<ResourceLocation> getOverrideLocations()
public Collection<ResourceLocation> getOverrideLocations()
{
return Collections.emptyList();
return Collections.emptyList();
}
@Override
@ -647,7 +647,7 @@ public enum B3DLoader implements ICustomModelLoader
}
@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();
IModelState modelState = this.state;
@ -723,7 +723,7 @@ public enum B3DLoader implements ICustomModelLoader
@Override
public Matrix4f apply(Node<?> node)
{
return global.compose(localCache.getUnchecked(node)).getMatrix();
return global.compose(localCache.getUnchecked(node)).getMatrixVec();
}
});
for(Face f : faces)
@ -834,7 +834,7 @@ public enum B3DLoader implements ICustomModelLoader
public ItemOverrideList getOverrides()
{
// TODO handle items
return ItemOverrideList.NONE;
return ItemOverrideList.EMPTY;
}
}
}

View File

@ -58,7 +58,7 @@ public enum OBJLoader implements ICustomModelLoader {
}
@Override
public void func_195410_a(IResourceManager resourceManager)
public void onResourceManagerReload(IResourceManager resourceManager)
{
this.manager = resourceManager;
cache.clear();
@ -82,14 +82,14 @@ public enum OBJLoader implements ICustomModelLoader {
{
try
{
resource = manager.func_199002_a(file);
resource = manager.getResource(file);
}
catch (FileNotFoundException e)
{
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/"))
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;
}
OBJModel.Parser parser = new OBJModel.Parser(resource, manager);

View File

@ -83,8 +83,8 @@ import com.google.common.collect.Maps;
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 MaterialLibrary matLib;
private final ResourceLocation modelLocation;
@ -103,7 +103,7 @@ public class OBJModel implements IUnbakedModel
}
@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();
List<ResourceLocation> textures = Lists.newArrayList();
@ -116,11 +116,11 @@ public class OBJModel implements IUnbakedModel
}
return textures;
}
@Override
public Collection<ResourceLocation> getOverrideLocations()
public Collection<ResourceLocation> getOverrideLocations()
{
return Collections.emptyList();
return Collections.emptyList();
}
@Override
@ -216,8 +216,8 @@ public class OBJModel implements IUnbakedModel
public Parser(IResource from, IResourceManager manager) throws IOException
{
this.manager = manager;
this.objFrom = from.func_199029_a();
this.objStream = new InputStreamReader(from.func_199027_b(), StandardCharsets.UTF_8);
this.objFrom = from.getLocation();
this.objStream = new InputStreamReader(from.getInputStream(), StandardCharsets.UTF_8);
this.objReader = new BufferedReader(objStream);
}
@ -517,7 +517,7 @@ public class OBJModel implements IUnbakedModel
String domain = from.getNamespace();
if (!path.contains("/"))
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);
String currentLine = "";
@ -857,7 +857,7 @@ public class OBJModel implements IUnbakedModel
public Face bake(TRSRTransformation transform)
{
Matrix4f m = transform.getMatrix();
Matrix4f m = transform.getMatrixVec();
Matrix3f mn = null;
Vertex[] vertices = new Vertex[verts.length];
// Normal[] normals = norms != null ? new Normal[norms.length] : null;
@ -1318,7 +1318,7 @@ public class OBJModel implements IUnbakedModel
// FIXME: merge with getQuads
@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 (quads == null)
@ -1598,7 +1598,7 @@ public class OBJModel implements IUnbakedModel
@Override
public ItemOverrideList getOverrides()
{
return ItemOverrideList.NONE;
return ItemOverrideList.EMPTY;
}
}

View File

@ -60,7 +60,7 @@ public class BlockInfo
{
if(cachedTint == tint) return cachedMultiplier;
cachedTint = tint;
cachedMultiplier = colors.colorMultiplier(state, world, blockPos, tint);
cachedMultiplier = colors.getColor(state, world, blockPos, tint);
return cachedMultiplier;
}

View File

@ -52,7 +52,7 @@ public class ForgeBlockModelRenderer extends BlockModelRenderer
}
@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)
{
@ -68,12 +68,12 @@ public class ForgeBlockModelRenderer extends BlockModelRenderer
}
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
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)
{
@ -89,7 +89,7 @@ public class ForgeBlockModelRenderer extends BlockModelRenderer
}
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.setBlockPos(pos);
boolean empty = true;
List<BakedQuad> quads = model.func_200117_a(state, null, rand);
List<BakedQuad> quads = model.getQuads(state, null, rand);
if(!quads.isEmpty())
{
lighter.updateBlockInfo();
@ -111,7 +111,7 @@ public class ForgeBlockModelRenderer extends BlockModelRenderer
}
for(EnumFacing side : EnumFacing.values())
{
quads = model.func_200117_a(state, side, rand);
quads = model.getQuads(state, side, rand);
if(!quads.isEmpty())
{
if(!checkSides || Block.shouldSideBeRendered(state, world, pos, side))

View File

@ -43,4 +43,4 @@ public abstract class TransformerConsumer implements IVertexConsumer {
}
protected abstract float[] transform(int element, float... data);
}
}

View File

@ -180,8 +180,8 @@ public class UnpackedBakedQuad extends BakedQuad
}
if(contractUVs)
{
float tX = texture.getIconWidth() / (texture.getMaxU() - texture.getMinU());
float tY = texture.getIconHeight() / (texture.getMaxV() - texture.getMinV());
float tX = texture.getWidth() / (texture.getMaxU() - texture.getMinU());
float tY = texture.getHeight() / (texture.getMaxV() - texture.getMinV());
float tS = tX > tY ? tX : tY;
float ep = 1f / (tS * 0x100);
int uve = 0;
@ -235,4 +235,4 @@ public class UnpackedBakedQuad extends BakedQuad
return new UnpackedBakedQuad(unpackedData, tint, orientation, texture, applyDiffuseLighting, format);
}
}
}
}

View File

@ -109,7 +109,7 @@ public class VertexLighterFlat extends QuadGatheringTransformer
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);
}

View File

@ -27,7 +27,7 @@ import net.minecraft.resources.IResourceManagerReloadListener;
public interface ISelectiveResourceReloadListener extends IResourceManagerReloadListener
{
@Override
default void func_195410_a(IResourceManager resourceManager)
default void onResourceManagerReload(IResourceManager resourceManager)
{
// For compatibility, call the selective version from the non-selective function
onResourceManagerReload(resourceManager, SelectiveReloadStateHandler.INSTANCE.get());

View File

@ -49,7 +49,7 @@ public enum KeyConflictContext implements IKeyConflictContext
@Override
public boolean isActive()
{
return Minecraft.getMinecraft().currentScreen != null;
return Minecraft.getInstance().currentScreen != null;
}
@Override

View File

@ -33,7 +33,7 @@ public enum KeyModifier {
@Override
public boolean matches(InputMappings.Input key)
{
int keyCode = key.func_197937_c();
int keyCode = key.getKeyCode();
if (Minecraft.IS_RUNNING_ON_MAC)
{
return keyCode == GLFW.GLFW_KEY_LEFT_ALT || keyCode == GLFW.GLFW_KEY_RIGHT_ALT;
@ -59,7 +59,7 @@ public enum KeyModifier {
@Override
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";
return I18n.format(localizationFormatKey, keyName);
}
@ -68,7 +68,7 @@ public enum KeyModifier {
@Override
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
@ -86,14 +86,14 @@ public enum KeyModifier {
@Override
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 {
@Override
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
@ -111,7 +111,7 @@ public enum KeyModifier {
@Override
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 {
@ -146,7 +146,7 @@ public enum KeyModifier {
@Override
public String getLocalizedComboName(InputMappings.Input key)
{
return key.func_197936_a();
return key.getName();
}
};

View File

@ -270,18 +270,18 @@ public class BiomeDictionary
*/
public static void makeBestGuess(Biome biome)
{
Type type = Type.fromVanilla(biome.func_201856_r());
Type type = Type.fromVanilla(biome.getCategory());
if (type != null)
{
BiomeDictionary.addTypes(biome, type);
}
if (biome.getRainfall() > 0.85f)
if (biome.getDownfall() > 0.85f)
{
BiomeDictionary.addTypes(biome, WET);
}
if (biome.getRainfall() < 0.15f)
if (biome.getDownfall() < 0.15f)
{
BiomeDictionary.addTypes(biome, DRY);
}
@ -296,14 +296,14 @@ public class BiomeDictionary
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);
}
if (biome.getBaseHeight() <= -0.5F)
if (biome.getDepth() <= -0.5F)
{
if (biome.getHeightVariation() == 0.0F)
if (biome.getScale() == 0.0F)
{
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);
}
if (biome.getHeightVariation() >= 1.5F)
if (biome.getScale() >= 1.5F)
{
BiomeDictionary.addTypes(biome, MOUNTAIN);
}
@ -367,76 +367,76 @@ public class BiomeDictionary
addTypes(Biomes.OCEAN, OCEAN );
addTypes(Biomes.PLAINS, PLAINS );
addTypes(Biomes.DESERT, HOT, DRY, SANDY );
addTypes(Biomes.EXTREME_HILLS, MOUNTAIN, HILLS );
addTypes(Biomes.MOUNTAINS, MOUNTAIN, HILLS );
addTypes(Biomes.FOREST, FOREST );
addTypes(Biomes.TAIGA, COLD, CONIFEROUS, FOREST );
addTypes(Biomes.SWAMPLAND, WET, SWAMP );
addTypes(Biomes.SWAMP, WET, SWAMP );
addTypes(Biomes.RIVER, RIVER );
addTypes(Biomes.HELL, HOT, DRY, NETHER );
addTypes(Biomes.SKY, COLD, DRY, END );
addTypes(Biomes.NETHER, HOT, DRY, NETHER );
addTypes(Biomes.THE_END, COLD, DRY, END );
addTypes(Biomes.FROZEN_OCEAN, COLD, OCEAN, SNOWY );
addTypes(Biomes.FROZEN_RIVER, COLD, RIVER, SNOWY );
addTypes(Biomes.ICE_PLAINS, COLD, SNOWY, WASTELAND );
addTypes(Biomes.ICE_MOUNTAINS, COLD, SNOWY, MOUNTAIN );
addTypes(Biomes.MUSHROOM_ISLAND, MUSHROOM, RARE );
addTypes(Biomes.MUSHROOM_ISLAND_SHORE, MUSHROOM, BEACH, RARE );
addTypes(Biomes.SNOWY_TUNDRA, COLD, SNOWY, WASTELAND );
addTypes(Biomes.SNOWY_MOUNTAINS, COLD, SNOWY, MOUNTAIN );
addTypes(Biomes.MUSHROOM_FIELDS, MUSHROOM, RARE );
addTypes(Biomes.MUSHROOM_FIELD_SHORE, MUSHROOM, BEACH, RARE );
addTypes(Biomes.BEACH, BEACH );
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.EXTREME_HILLS_EDGE, MOUNTAIN );
addTypes(Biomes.MOUNTAIN_EDGE, MOUNTAIN );
addTypes(Biomes.JUNGLE, HOT, WET, DENSE, JUNGLE );
addTypes(Biomes.JUNGLE_HILLS, HOT, WET, DENSE, JUNGLE, HILLS );
addTypes(Biomes.JUNGLE_EDGE, HOT, WET, JUNGLE, FOREST, RARE );
addTypes(Biomes.DEEP_OCEAN, OCEAN );
addTypes(Biomes.STONE_BEACH, BEACH );
addTypes(Biomes.COLD_BEACH, COLD, BEACH, SNOWY );
addTypes(Biomes.STONE_SHORE, BEACH );
addTypes(Biomes.SNOWY_BEACH, COLD, BEACH, SNOWY );
addTypes(Biomes.BIRCH_FOREST, FOREST );
addTypes(Biomes.BIRCH_FOREST_HILLS, FOREST, HILLS );
addTypes(Biomes.ROOFED_FOREST, SPOOKY, DENSE, FOREST );
addTypes(Biomes.COLD_TAIGA, COLD, CONIFEROUS, FOREST, SNOWY );
addTypes(Biomes.COLD_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, SNOWY, HILLS );
addTypes(Biomes.REDWOOD_TAIGA, COLD, CONIFEROUS, FOREST );
addTypes(Biomes.REDWOOD_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS );
addTypes(Biomes.EXTREME_HILLS_WITH_TREES, MOUNTAIN, FOREST, SPARSE );
addTypes(Biomes.DARK_FOREST, SPOOKY, DENSE, FOREST );
addTypes(Biomes.SNOWY_TAIGA, COLD, CONIFEROUS, FOREST, SNOWY );
addTypes(Biomes.SNOWY_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, SNOWY, HILLS );
addTypes(Biomes.GIANT_TREE_TAIGA, COLD, CONIFEROUS, FOREST );
addTypes(Biomes.GIANT_TREE_TAIGA_HILLS, COLD, CONIFEROUS, FOREST, HILLS );
addTypes(Biomes.WOODED_MOUNTAINS, MOUNTAIN, FOREST, SPARSE );
addTypes(Biomes.SAVANNA, HOT, SAVANNA, PLAINS, SPARSE );
addTypes(Biomes.SAVANNA_PLATEAU, HOT, SAVANNA, PLAINS, SPARSE, RARE );
addTypes(Biomes.MESA, MESA, SANDY );
addTypes(Biomes.MESA_ROCK, MESA, SPARSE, SANDY );
addTypes(Biomes.MESA_CLEAR_ROCK, MESA, SANDY );
addTypes(Biomes.field_201936_P, END );
addTypes(Biomes.field_201937_Q, END );
addTypes(Biomes.field_201938_R, END );
addTypes(Biomes.field_201939_S, END );
addTypes(Biomes.field_203614_T, OCEAN, HOT );
addTypes(Biomes.field_203615_U, OCEAN );
addTypes(Biomes.field_203616_V, OCEAN, COLD );
addTypes(Biomes.field_203617_W, OCEAN, HOT );
addTypes(Biomes.field_203618_X, OCEAN );
addTypes(Biomes.field_203619_Y, OCEAN, COLD );
addTypes(Biomes.field_203620_Z, OCEAN, COLD );
addTypes(Biomes.VOID, VOID );
addTypes(Biomes.MUTATED_PLAINS, PLAINS, RARE );
addTypes(Biomes.MUTATED_DESERT, HOT, DRY, SANDY, RARE );
addTypes(Biomes.MUTATED_EXTREME_HILLS, MOUNTAIN, SPARSE, RARE );
addTypes(Biomes.MUTATED_FOREST, FOREST, HILLS, RARE );
addTypes(Biomes.MUTATED_TAIGA, COLD, CONIFEROUS, FOREST, MOUNTAIN, RARE );
addTypes(Biomes.MUTATED_SWAMPLAND, WET, SWAMP, HILLS, RARE );
addTypes(Biomes.MUTATED_ICE_FLATS, COLD, SNOWY, HILLS, RARE );
addTypes(Biomes.MUTATED_JUNGLE, HOT, WET, DENSE, JUNGLE, MOUNTAIN, RARE);
addTypes(Biomes.MUTATED_JUNGLE_EDGE, HOT, SPARSE, JUNGLE, HILLS, RARE );
addTypes(Biomes.MUTATED_BIRCH_FOREST, FOREST, DENSE, HILLS, RARE );
addTypes(Biomes.MUTATED_BIRCH_FOREST_HILLS, FOREST, DENSE, MOUNTAIN, RARE );
addTypes(Biomes.MUTATED_ROOFED_FOREST, SPOOKY, DENSE, FOREST, MOUNTAIN, RARE );
addTypes(Biomes.MUTATED_TAIGA_COLD, COLD, CONIFEROUS, FOREST, SNOWY, MOUNTAIN, RARE);
addTypes(Biomes.MUTATED_REDWOOD_TAIGA, DENSE, FOREST, RARE );
addTypes(Biomes.MUTATED_REDWOOD_TAIGA_HILLS, DENSE, FOREST, HILLS, RARE );
addTypes(Biomes.MUTATED_EXTREME_HILLS_WITH_TREES, MOUNTAIN, SPARSE, RARE );
addTypes(Biomes.MUTATED_SAVANNA, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
addTypes(Biomes.MUTATED_SAVANNA_ROCK, HOT, DRY, SPARSE, SAVANNA, HILLS, RARE);
addTypes(Biomes.MUTATED_MESA, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
addTypes(Biomes.MUTATED_MESA_ROCK, HOT, DRY, SPARSE, HILLS, RARE );
addTypes(Biomes.MUTATED_MESA_CLEAR_ROCK, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
addTypes(Biomes.BADLANDS, MESA, SANDY );
addTypes(Biomes.WOODED_BADLANDS_PLATEAU, MESA, SPARSE, SANDY );
addTypes(Biomes.BADLANDS_PLATEAU, MESA, SANDY );
addTypes(Biomes.SMALL_END_ISLANDS, END );
addTypes(Biomes.END_MIDLANDS, END );
addTypes(Biomes.END_HIGHLANDS, END );
addTypes(Biomes.END_BARRENS, END );
addTypes(Biomes.WARM_OCEAN, OCEAN, HOT );
addTypes(Biomes.LUKEWARM_OCEAN, OCEAN );
addTypes(Biomes.COLD_OCEAN, OCEAN, COLD );
addTypes(Biomes.DEEP_WARM_OCEAN, OCEAN, HOT );
addTypes(Biomes.DEEP_LUKEWARM_OCEAN, OCEAN );
addTypes(Biomes.DEEP_COLD_OCEAN, OCEAN, COLD );
addTypes(Biomes.DEEP_FROZEN_OCEAN, OCEAN, COLD );
addTypes(Biomes.THE_VOID, VOID );
addTypes(Biomes.SUNFLOWER_PLAINS, PLAINS, RARE );
addTypes(Biomes.DESERT_LAKES, HOT, DRY, SANDY, RARE );
addTypes(Biomes.GRAVELLY_MOUNTAINS, MOUNTAIN, SPARSE, RARE );
addTypes(Biomes.FLOWER_FOREST, FOREST, HILLS, RARE );
addTypes(Biomes.TAIGA_MOUNTAINS, COLD, CONIFEROUS, FOREST, MOUNTAIN, RARE );
addTypes(Biomes.SWAMP_HILLS, WET, SWAMP, HILLS, RARE );
addTypes(Biomes.ICE_SPIKES, COLD, SNOWY, HILLS, RARE );
addTypes(Biomes.MODIFIED_JUNGLE, HOT, WET, DENSE, JUNGLE, MOUNTAIN, RARE);
addTypes(Biomes.MODIFIED_JUNGLE_EDGE, HOT, SPARSE, JUNGLE, HILLS, RARE );
addTypes(Biomes.TALL_BIRCH_FOREST, FOREST, DENSE, HILLS, RARE );
addTypes(Biomes.TALL_BIRCH_HILLS, FOREST, DENSE, MOUNTAIN, RARE );
addTypes(Biomes.DARK_FOREST_HILLS, SPOOKY, DENSE, FOREST, MOUNTAIN, RARE );
addTypes(Biomes.SNOWY_TAIGA_MOUNTAINS, COLD, CONIFEROUS, FOREST, SNOWY, MOUNTAIN, RARE);
addTypes(Biomes.GIANT_SPRUCE_TAIGA, DENSE, FOREST, RARE );
addTypes(Biomes.GIANT_SPRUCE_TAIGA_HILLS, DENSE, FOREST, HILLS, RARE );
addTypes(Biomes.MODIFIED_GRAVELLY_MOUNTAINS, MOUNTAIN, SPARSE, RARE );
addTypes(Biomes.SHATTERED_SAVANNA, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
addTypes(Biomes.SHATTERED_SAVANNA_PLATEAU, HOT, DRY, SPARSE, SAVANNA, HILLS, RARE);
addTypes(Biomes.ERODED_BADLANDS, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
addTypes(Biomes.MODIFIED_WOODED_BADLANDS_PLATEAU, HOT, DRY, SPARSE, HILLS, RARE );
addTypes(Biomes.MODIFIED_BADLANDS_PLATEAU, HOT, DRY, SPARSE, SAVANNA, MOUNTAIN, RARE);
if (DEBUG)

View File

@ -52,25 +52,25 @@ public class BiomeManager
List<BiomeEntry> list = new ArrayList<BiomeEntry>();
list.add(new BiomeEntry(Biomes.FOREST, 10));
list.add(new BiomeEntry(Biomes.ROOFED_FOREST, 10));
list.add(new BiomeEntry(Biomes.EXTREME_HILLS, 10));
list.add(new BiomeEntry(Biomes.DARK_FOREST, 10));
list.add(new BiomeEntry(Biomes.MOUNTAINS, 10));
list.add(new BiomeEntry(Biomes.PLAINS, 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);
list.clear();
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.PLAINS, 10));
currentBiomes[BiomeType.COOL.ordinal()] = new TrackedList<BiomeEntry>(list);
list.clear();
list.add(new BiomeEntry(Biomes.ICE_PLAINS, 30));
list.add(new BiomeEntry(Biomes.COLD_TAIGA, 10));
list.add(new BiomeEntry(Biomes.SNOWY_TUNDRA, 30));
list.add(new BiomeEntry(Biomes.SNOWY_TAIGA, 10));
currentBiomes[BiomeType.ICY.ordinal()] = new TrackedList<BiomeEntry>(list);
list.clear();
@ -82,17 +82,17 @@ public class BiomeManager
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)
{
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);
}
}

View File

@ -173,7 +173,7 @@ public class DimensionManager
public static Dimension getProvider(int dim)
{
return getWorld(dim).provider;
return getWorld(dim).dimension;
}
public static Integer[] getIDs(boolean check)
@ -219,7 +219,7 @@ public class DimensionManager
{
worlds.put(id, 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
{
@ -264,7 +264,7 @@ public class DimensionManager
LOGGER.error(DIMMGR,"Cannot Hotload Dim: {}", dim, e);
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();
//WorldSettings worldSettings = new WorldSettings(overworld.getWorldInfo());
@ -329,7 +329,7 @@ public class DimensionManager
{
if (dimensions.containsKey(dim))
{
Dimension ret = getProviderType(dim).createDimension();
Dimension ret = getProviderType(dim).create();
ret.setId(dim);
return ret;
}
@ -361,8 +361,8 @@ public class DimensionManager
{
return ForgeChunkManager.getPersistentChunksFor(world).isEmpty()
&& world.playerEntities.isEmpty()
&& !world.provider.getDimensionType().shouldLoadSpawn()
&& !keepLoaded.contains(world.provider.getId());
&& !world.dimension.getType().shouldLoadSpawn()
&& !keepLoaded.contains(world.dimension.getId());
}
/**
@ -421,7 +421,7 @@ public class DimensionManager
{
MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(w));
w.close();
setWorld(id, null, w.getMinecraftServer());
setWorld(id, null, w.getServer());
}
}
}

View File

@ -456,7 +456,7 @@ public class ForgeChunkManager
try
{
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)
{
@ -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);
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++)
{
NBTTagCompound ticketHolder = ticketList.getCompoundTagAt(i);
NBTTagCompound ticketHolder = ticketList.getCompound(i);
String modId = ticketHolder.getString("Owner");
boolean isPlayer = ForgeVersion.MOD_ID.equals(modId);
@ -518,17 +518,17 @@ public class ForgeChunkManager
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++)
{
NBTTagCompound ticket = tickets.getCompoundTagAt(j);
NBTTagCompound ticket = tickets.getCompound(j);
modId = ticket.hasKey("ModId") ? ticket.getString("ModId") : modId;
Type type = Type.values()[ticket.getByte("Type")];
//byte ticketChunkDepth = ticket.getByte("ChunkListDepth");
Ticket tick = new Ticket(modId, type, world);
if (ticket.hasKey("ModData"))
{
tick.modData = ticket.getCompoundTag("ModData");
tick.modData = ticket.getCompound("ModData");
}
if (ticket.hasKey("Player"))
{
@ -545,8 +545,8 @@ public class ForgeChunkManager
}
if (type == Type.ENTITY)
{
tick.entityChunkX = ticket.getInteger("chunkX");
tick.entityChunkZ = ticket.getInteger("chunkZ");
tick.entityChunkX = ticket.getInt("chunkX");
tick.entityChunkZ = ticket.getInt("chunkZ");
UUID uuid = new UUID(ticket.getLong("PersistentIDMSB"), ticket.getLong("PersistentIDLSB"));
// add the ticket to the "pending entity" list
pendingEntities.put(uuid, tick);
@ -936,10 +936,10 @@ public class ForgeChunkManager
{
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.setInteger("chunkZ", MathHelper.floor(tick.entity.chunkCoordZ));
ticket.setInt("chunkX", MathHelper.floor(tick.entity.chunkCoordX));
ticket.setInt("chunkZ", MathHelper.floor(tick.entity.chunkCoordZ));
ticket.setLong("PersistentIDMSB", tick.entity.getUniqueID().getMostSignificantBits());
ticket.setLong("PersistentIDLSB", tick.entity.getUniqueID().getLeastSignificantBits());
tickets.add(ticket);
@ -996,8 +996,8 @@ public class ForgeChunkManager
ChunkEntry entry = cache.getIfPresent(ChunkPos.asLong(chunk.x, chunk.z));
if (entry != null)
{
entry.nbt.setTag("Entities", nbt.getTagList("Entities", Constants.NBT.TAG_COMPOUND));
entry.nbt.setTag("TileEntities", nbt.getTagList("TileEntities", Constants.NBT.TAG_COMPOUND));
entry.nbt.setTag("Entities", nbt.getList("Entities", Constants.NBT.TAG_COMPOUND));
entry.nbt.setTag("TileEntities", nbt.getList("TileEntities", Constants.NBT.TAG_COMPOUND));
ClassInheritanceMultiMap<Entity>[] entityLists = chunk.getEntityLists();
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)
{
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)
{
AnvilChunkLoader.readChunkEntity(entities.getCompoundTagAt(i), world, chunk);
AnvilChunkLoader.readChunkEntity(entities.getCompound(i), world, chunk);
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)
{
TileEntity tileEntity = TileEntity.func_203403_c(tileEntities.getCompoundTagAt(i));
TileEntity tileEntity = TileEntity.create(tileEntities.getCompound(i));
if (tileEntity != null) chunk.addTileEntity(tileEntity);
}
}

View File

@ -456,10 +456,10 @@ public class ForgeHooks
}
*/
ItemStack result;
boolean isCreative = player.capabilities.isCreativeMode;
boolean isCreative = player.abilities.isCreativeMode;
TileEntity te = null;
if (target.typeOfHit == RayTraceResult.Type.BLOCK)
if (target.type == RayTraceResult.Type.BLOCK)
{
IBlockState state = world.getBlockState(target.getBlockPos());
@ -475,12 +475,12 @@ public class ForgeHooks
}
else
{
if (target.typeOfHit != RayTraceResult.Type.ENTITY || target.entityHit == null || !isCreative)
if (target.type != RayTraceResult.Type.ENTITY || target.entity == null || !isCreative)
{
return false;
}
result = target.entityHit.getPickedResult(target);
result = target.entity.getPickedResult(target);
}
if (result.isEmpty())
@ -490,13 +490,13 @@ public class ForgeHooks
if (te != null)
{
Minecraft.getMinecraft().storeTEInStack(result, te);
Minecraft.getInstance().storeTEInStack(result, te);
}
if (isCreative)
{
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;
}
int slot = player.inventory.getSlotFor(result);
@ -505,7 +505,7 @@ public class ForgeHooks
if (InventoryPlayer.isHotbar(slot))
player.inventory.currentItem = slot;
else
Minecraft.getMinecraft().playerController.pickItem(slot);
Minecraft.getInstance().playerController.pickItem(slot);
return true;
}
return false;
@ -610,7 +610,7 @@ public class ForgeHooks
}
else
{
AxisAlignedBB bb = entity.getEntityBoundingBox();
AxisAlignedBB bb = entity.getBoundingBox();
int mX = MathHelper.floor(bb.minX);
int mY = MathHelper.floor(bb.minY);
int mZ = MathHelper.floor(bb.minZ);
@ -769,7 +769,7 @@ public class ForgeHooks
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;
}
}
@ -809,8 +809,8 @@ public class ForgeHooks
/* TODO: Talk to Sponge folk about World rollbacks.
public static EnumActionResult onPlaceItemIntoWorld(@Nonnull ItemUseContext context)
{
ItemStack itemstack = context.func_195996_i();
World world = context.func_195991_k();
ItemStack itemstack = context.getItem();
World world = context.getWorld();
// handle all placement events here
int meta = itemstack.getItemDamage();
@ -826,7 +826,7 @@ public class ForgeHooks
world.captureBlockSnapshots = true;
}
EnumActionResult ret = itemstack.getItem().func_195939_a(context);
EnumActionResult ret = itemstack.getItem().onItemUse(context);
world.captureBlockSnapshots = false;
if (ret == EnumActionResult.SUCCESS)
@ -845,15 +845,15 @@ public class ForgeHooks
world.capturedBlockSnapshots.clear();
// make sure to set pre-placement item data for event
itemstack.func_196085_b(meta);
itemstack.setDamage(meta);
itemstack.setCount(size);
if (nbt != null)
{
itemstack.setTagCompound(nbt);
}
EntityPlayer player = context.func_195999_j();
EnumFacing side = context.func_196000_l();
EntityPlayer player = context.getPlayer();
EnumFacing side = context.getFace();
if (blockSnapshots.size() > 1)
{
@ -878,7 +878,7 @@ public class ForgeHooks
else
{
// Change the stack to its new content
itemstack.func_196085_b(newMeta);
itemstack.setDamage(newMeta);
itemstack.setCount(newSize);
if (nbt != null)
{
@ -940,7 +940,7 @@ public class ForgeHooks
if (stack.getItem().hasContainerItem(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);
return ItemStack.EMPTY;
@ -1232,7 +1232,7 @@ public class ForgeHooks
NBTTagList enchantmentsNbt = ItemEnchantedBook.getEnchantments(itemStack);
if (enchantmentsNbt.size() == 1)
{
NBTTagCompound nbttagcompound = enchantmentsNbt.getCompoundTagAt(0);
NBTTagCompound nbttagcompound = enchantmentsNbt.getCompound(0);
Enchantment enchantment = Enchantment.getEnchantmentByID(nbttagcompound.getShort("id"));
if (enchantment != null)
{
@ -1255,7 +1255,7 @@ public class ForgeHooks
}
else if (item instanceof ItemSpawnEgg)
{
ResourceLocation resourceLocation = ((ItemSpawnEgg)item).func_208076_b(null).getRegistryName();
ResourceLocation resourceLocation = ((ItemSpawnEgg)item).getType(null).getRegistryName();
if (resourceLocation != null)
{
return resourceLocation.getNamespace();
@ -1319,8 +1319,8 @@ public class ForgeHooks
}
@Override
public IFluidState func_204610_c(BlockPos p_204610_1_) {
return Fluids.field_204541_a.func_207188_f();
public IFluidState getFluidState(BlockPos pos) {
return Fluids.EMPTY.getDefaultState();
}
}

View File

@ -323,7 +323,7 @@ public class ForgeMod implements WorldPersistenceHooks.WorldPersistenceHook
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
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);
}

View File

@ -27,4 +27,4 @@ public interface IPlantable
{
EnumPlantType getPlantType(IWorldReader world, BlockPos pos);
IBlockState getPlant(IWorldReader world, BlockPos pos);
}
}

View File

@ -137,7 +137,7 @@ public interface ISpecialArmor
}
double totalArmor = entity.getTotalArmorValue();
double totalToughness = entity.getEntityAttribute(SharedMonsterAttributes.ARMOR_TOUGHNESS).getAttributeValue();
double totalToughness = entity.getAttribute(SharedMonsterAttributes.ARMOR_TOUGHNESS).getValue();
if (source.isUnblockable())
{
@ -169,7 +169,7 @@ public interface ISpecialArmor
{
ItemArmor armor = (ItemArmor)stack.getItem();
prop = new ArmorProperties(0, 0, Integer.MAX_VALUE);
prop.Armor = armor.func_200881_e();
prop.Armor = armor.getDamageReduceAmount();
prop.Toughness = armor.getToughness();
}
if (prop != null)

View File

@ -63,7 +63,7 @@ public class WorldSpecificSaveHandler implements ISaveHandler
@Override public IPlayerFileData getPlayerNBTManager() { return parent.getPlayerNBTManager(); }
@Override public void flush() { parent.flush(); }
@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
public File getMapFileFromName(String name)
@ -76,7 +76,7 @@ public class WorldSpecificSaveHandler implements ISaveHandler
File file = new File(dataDir, name + ".dat");
if (!file.exists())
{
switch (world.provider.getId())
switch (world.dimension.getId())
{
case -1:
if (name.equalsIgnoreCase("FORTRESS")) copyFile(name, file);

View File

@ -40,7 +40,7 @@ public class VanillaBrewingRecipe implements IBrewingRecipe {
public boolean isInput(ItemStack stack)
{
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;
}
/**

View File

@ -124,7 +124,7 @@ public class ChunkIOExecutor
ChunkIOProvider task = tasks.get(key);
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;
}

View File

@ -57,8 +57,8 @@ class QueuedChunk {
result.append(" x: " + x + NEW_LINE);
result.append(" z: " + z + NEW_LINE);
result.append(" world: " + world.getWorldInfo().getWorldName() + NEW_LINE);
result.append(" dimension: " + world.provider.getId() + NEW_LINE);
result.append(" provider: " + world.provider.getClass().getName() + NEW_LINE);
result.append(" dimension: " + world.dimension.getId() + NEW_LINE);
result.append(" provider: " + world.dimension.getClass().getName() + NEW_LINE);
result.append("}");
return result.toString();

View File

@ -439,4 +439,4 @@ public class ConfigCategory implements Map<String, Property>
changed = true;
}
}
}
}

View File

@ -118,7 +118,7 @@ public class CompoundIngredient extends Ingredient
@Override
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
@ -131,7 +131,7 @@ public class CompoundIngredient extends Ingredient
public void write(PacketBuffer buffer, CompoundIngredient ingredient)
{
buffer.writeVarInt(ingredient.children.size());
ingredient.children.forEach(c -> c.func_199564_a(buffer));
ingredient.children.forEach(c -> c.writeToBuffer(buffer));
}
}

View File

@ -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<Ingredient> INGREDIENT_VANILLA = register(new ResourceLocation("minecraft", "item"), new IIngredientSerializer<Ingredient>() {
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) {
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) {
@ -248,9 +248,9 @@ public class CraftingHelper
tmp.setTag("tag", nbt);
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)
{
@ -292,15 +292,15 @@ public class CraftingHelper
public static void reloadConstants(IResourceManager manager) {
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();
if (!path.equals("recipes/_constants.json")) //Top level only
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++)
{
JsonObject json = elements[x];
@ -328,7 +328,7 @@ public class CraftingHelper
constants.put(new ResourceLocation(JsonUtils.getString(json, "name")), new StackList(items));
}
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"))
constants.put(new ResourceLocation(JsonUtils.getString(json, "name")), new StackList(Lists.newArrayList(getItemStack(JsonUtils.getJsonObject(json, "item"), true))));
else

View File

@ -44,7 +44,7 @@ public class IngredientNBT extends Ingredient
if (input == null)
return false;
//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

View File

@ -37,13 +37,13 @@ public class StackList implements IItemList
}
@Override
public Collection<ItemStack> func_199799_a()
public Collection<ItemStack> getStacks()
{
return items;
}
@Override
public JsonObject func_200303_b()
public JsonObject toJson()
{
if (items.size() == 1)
return toJson(items.iterator().next());
@ -61,8 +61,8 @@ public class StackList implements IItemList
ret.addProperty("item", stack.getItem().getRegistryName().toString());
if (stack.getCount() != 1)
ret.addProperty("count", stack.getCount());
if (stack.getTagCompound() != null)
ret.addProperty("nbt", stack.getTagCompound().toString()); //TODO: Better serialization?
if (stack.getTag() != null)
ret.addProperty("nbt", stack.getTag().toString()); //TODO: Better serialization?
return ret;
}

View File

@ -23,4 +23,4 @@
package net.minecraftforge.common.crafting;
import mcp.MethodsReturnNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;

View File

@ -139,7 +139,7 @@ public interface IForgeBlock
*/
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)
{
((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)
{
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)
{
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)
{
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
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;
}
if (plant.getBlock() == Blocks.field_196608_cF)
if (plant.getBlock() == Blocks.SUGAR_CANE)
{
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;
}
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;
case Nether: return this.getBlock() == Blocks.SOUL_SAND;
case Crop: return this.getBlock() == Blocks.FARMLAND;
@ -578,7 +578,7 @@ public interface IForgeBlock
default boolean isFertile(IBlockState state, IWorldReader world, BlockPos pos)
{
if (this.getBlock() == Blocks.FARMLAND)
return state.getValue(BlockFarmland.MOISTURE) > 0;
return state.get(BlockFarmland.MOISTURE) > 0;
return false;
}
@ -598,7 +598,7 @@ public interface IForgeBlock
*/
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)
{
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)
{
@ -640,13 +640,13 @@ public interface IForgeBlock
IBlockState newState;
@SuppressWarnings("unchecked")
IProperty<EnumFacing> facingIProperty = (IProperty<EnumFacing>) prop;
EnumFacing facing = state.getValue(facingIProperty);
EnumFacing facing = state.get(facingIProperty);
Collection<EnumFacing> validFacing = facingIProperty.getAllowedValues();
// rotate horizontal facings clockwise
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
{
@ -654,11 +654,11 @@ public interface IForgeBlock
EnumFacing rotatedFacing = facing.rotateAround(axis.getAxis());
if (validFacing.contains(rotatedFacing))
{
newState = state.func_206870_a(facingIProperty, rotatedFacing);
newState = state.with(facingIProperty, rotatedFacing);
}
else // abnormal facing property, just cycle it
{
newState = state.cycleProperty(facingIProperty);
newState = state.cycle(facingIProperty);
}
}
@ -879,7 +879,7 @@ public interface IForgeBlock
@SuppressWarnings("deprecation")
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);
}

View File

@ -52,7 +52,7 @@ public interface IForgeEntity extends ICapabilitySerializable<NBTTagCompound>
default void deserializeNBT(NBTTagCompound nbt)
{
getEntity().readFromNBT(nbt);
getEntity().read(nbt);
}
default NBTTagCompound serializeNBT()
@ -63,7 +63,7 @@ public interface IForgeEntity extends ICapabilitySerializable<NBTTagCompound>
{
ret.setString("id", getEntity().getEntityString());
}
return getEntity().writeToNBT(ret);
return getEntity().writeWithoutTypeId(ret);
}
boolean canUpdate();
@ -125,7 +125,7 @@ public interface IForgeEntity extends ICapabilitySerializable<NBTTagCompound>
}
else
{
ItemSpawnEgg egg = ItemSpawnEgg.func_200889_b(getEntity().func_200600_R());
ItemSpawnEgg egg = ItemSpawnEgg.getEgg(getEntity().getType());
if (egg != null) return new ItemStack(egg);
}
return ItemStack.EMPTY;

View File

@ -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)
{
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)
{
return state.func_210200_l();
return state.getExplosionResistance();
}
}

View File

@ -49,7 +49,7 @@ public interface IForgeFluidState
*/
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)
{
return getFluidState().func_206886_c().getExplosionResistance(getFluidState(), world, pos, exploder, explosion);
return getFluidState().getFluid().getExplosionResistance(getFluidState(), world, pos, exploder, explosion);
}
}

View File

@ -70,7 +70,7 @@ public interface IForgeItem
@SuppressWarnings("deprecation")
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
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)
{
stack.setTagCompound(nbt);
stack.setTag(nbt);
}
/**
@ -286,7 +286,7 @@ public interface IForgeItem
*/
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)
{
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)
{
return stack.isItemDamaged();
return stack.isDamaged();
}
/**
@ -479,7 +479,7 @@ public interface IForgeItem
*/
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)
{
return stack.getItemDamage() > 0;
return stack.getDamage() > 0;
}
/**
@ -529,7 +529,7 @@ public interface IForgeItem
*/
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")
default int getItemStackLimit(ItemStack stack)
{
return getItem().getItemStackLimit();
return getItem().getMaxStackSize();
}
Set<ToolType> getToolTypes(ItemStack stack);
@ -654,7 +654,7 @@ public interface IForgeItem
default boolean shouldCauseBlockBreakReset(ItemStack oldStack, ItemStack newStack)
{
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();
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));
}
return builder.build();

View File

@ -101,16 +101,16 @@ public interface IForgeItemStack extends ICapabilitySerializable<NBTTagCompound>
default EnumActionResult onItemUseFirst(ItemUseContext context)
{
EntityPlayer entityplayer = context.func_195999_j();
BlockPos blockpos = context.func_195995_a();
BlockWorldState blockworldstate = new BlockWorldState(context.func_195991_k(), blockpos, false);
if (entityplayer != null && !entityplayer.capabilities.allowEdit && !getStack().func_206847_b(context.func_195991_k().func_205772_D(), blockworldstate)) {
EntityPlayer entityplayer = context.getPlayer();
BlockPos blockpos = context.getPos();
BlockWorldState blockworldstate = new BlockWorldState(context.getWorld(), blockpos, false);
if (entityplayer != null && !entityplayer.abilities.allowEdit && !getStack().canPlaceOn(context.getWorld().getTags(), blockworldstate)) {
return EnumActionResult.PASS;
} else {
Item item = getStack().getItem();
EnumActionResult enumactionresult = item.onItemUseFirst(getStack(), context);
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;
@ -120,7 +120,7 @@ public interface IForgeItemStack extends ICapabilitySerializable<NBTTagCompound>
default NBTTagCompound serializeNBT()
{
NBTTagCompound ret = new NBTTagCompound();
getStack().writeToNBT(ret);
getStack().write(ret);
return ret;
}

View File

@ -30,14 +30,14 @@ public interface IForgeTileEntity extends ICapabilitySerializable<NBTTagCompound
@Override
default void deserializeNBT(NBTTagCompound nbt)
{
getTileEntity().readFromNBT(nbt);
getTileEntity().read(nbt);
}
@Override
default NBTTagCompound serializeNBT()
{
NBTTagCompound ret = new NBTTagCompound();
getTileEntity().writeToNBT(ret);
getTileEntity().write(ret);
return ret;
}
}

View File

@ -33,4 +33,4 @@ public interface IModelState
* if no part is provided, global model transformation is returned.
*/
Optional<TRSRTransformation> apply(Optional<? extends IModelPart> part);
}
}

View File

@ -29,7 +29,7 @@ import net.minecraft.util.EnumFacing;
*/
public interface ITransformation
{
Matrix4f getMatrix();
Matrix4f getMatrixVec();
EnumFacing rotate(EnumFacing facing);

View File

@ -116,7 +116,7 @@ public final class TRSRTransformation implements IModelState, ITransformation
@OnlyIn(Dist.CLIENT)
public static Matrix4f getMatrix(EnumFacing facing)
{
return getRotation(facing).getMatrix();
return getRotation(facing).getMatrixVec();
}
@OnlyIn(Dist.CLIENT)
@ -153,15 +153,15 @@ public final class TRSRTransformation implements IModelState, ITransformation
{
if (this.isIdentity()) return b;
if (b.isIdentity()) return this;
Matrix4f m = getMatrix();
m.mul(b.getMatrix());
Matrix4f m = getMatrixVec();
m.mul(b.getMatrixVec());
return new TRSRTransformation(m);
}
public TRSRTransformation inverse()
{
if (this.isIdentity()) return this;
Matrix4f m = getMatrix();
Matrix4f m = getMatrixVec();
m.invert();
return new TRSRTransformation(m);
}
@ -547,7 +547,7 @@ public final class TRSRTransformation implements IModelState, ITransformation
}
@Override
public Matrix4f getMatrix()
public Matrix4f getMatrixVec()
{
return (Matrix4f)matrix.clone();
}
@ -645,7 +645,7 @@ public final class TRSRTransformation implements IModelState, ITransformation
{
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.m03 = tmp.m13 = tmp.m23 = .5f;
ret.mul(tmp, ret);
@ -661,7 +661,7 @@ public final class TRSRTransformation implements IModelState, ITransformation
{
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.m03 = tmp.m13 = tmp.m23 = -.5f;
ret.mul(tmp, ret);
@ -692,28 +692,28 @@ public final class TRSRTransformation implements IModelState, ITransformation
@OnlyIn(Dist.CLIENT)
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)
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)
public static Matrix4f toVecmath(net.minecraft.client.renderer.Matrix4f m)
{
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.func_195885_a(0, 1), m.func_195885_a(1, 1), m.func_195885_a(2, 1), m.func_195885_a(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.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, 0), m.get(1, 0), m.get(2, 0), m.get(3, 0),
m.get(0, 1), m.get(1, 1), m.get(2, 1), m.get(3, 1),
m.get(0, 2), m.get(1, 2), m.get(2, 2), m.get(3, 2),
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)
{
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)
@ -738,7 +738,7 @@ public final class TRSRTransformation implements IModelState, ITransformation
m.getRow(x, row);
for (int y = 0; y < 4; y++)
{
r.func_195878_a(x, y, row[y]);
r.set(x, y, row[y]);
}
}
return r;

View File

@ -218,13 +218,13 @@ public final class AnimationStateMachine implements IAnimationStateMachine
@OnlyIn(Dist.CLIENT)
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();
ParameterResolver parameterResolver = new ParameterResolver(customParameters);
Clips.CommonClipTypeAdapterFactory.INSTANCE.setClipResolver(clipResolver);
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;
parameterResolver.asm = asm;
asm.initialize();

View File

@ -580,4 +580,4 @@ public final class Clips
};
}
}
}
}

View File

@ -44,4 +44,4 @@ public class FluidIdRegistryMessageHandler extends SimpleChannelInboundHandler<F
}
}
*/
*/

View File

@ -56,4 +56,4 @@ public class ForgeNetworkHandler
clientChannel.pipeline().addAfter(handlerName, "FluidIdRegistryHandler", new FluidIdRegistryMessageHandler());
}
}
*/
*/

View File

@ -41,4 +41,4 @@ public class ForgeRuntimeCodec extends FMLIndexedMessageToMessageCodec<ForgeMess
msg.fromBytes(source);
}
}
*/
*/

View File

@ -36,4 +36,4 @@ public class ServerToClientConnectionEstablishedHandler extends ChannelInboundHa
ctx.fireUserEventTriggered(evt);
}
}
*/
*/

View File

@ -99,9 +99,9 @@ public class ExtendedStateContainer<O, S extends IExtendedState<S>> extends Stat
@Override
@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) {
return (S) this;
}
@ -111,7 +111,7 @@ public class ExtendedStateContainer<O, S extends IExtendedState<S>> extends Stat
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
@ -128,7 +128,7 @@ public class ExtendedStateContainer<O, S extends IExtendedState<S>> extends Stat
}
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;
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
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

View File

@ -63,7 +63,7 @@ public class BlockSnapshot
public BlockSnapshot(World world, BlockPos pos, IBlockState state, @Nullable NBTTagCompound nbt)
{
this.setWorld(world);
this.dimId = world.provider.getId();
this.dimId = world.dimension.getId();
this.pos = pos.toImmutable();
this.setReplacedBlock(state);
this.registryName = state.getBlock().getRegistryName();
@ -113,12 +113,12 @@ public class BlockSnapshot
public static BlockSnapshot readFromNBT(NBTTagCompound tag)
{
return new BlockSnapshot(
tag.getInteger("dimension"),
new BlockPos(tag.getInteger("posX"), tag.getInteger("posY"), tag.getInteger("posZ")),
tag.getInt("dimension"),
new BlockPos(tag.getInt("posX"), tag.getInt("posY"), tag.getInt("posZ")),
new ResourceLocation(tag.getString("blockMod"), tag.getString("blockName")),
tag.getInteger("metadata"),
tag.getInteger("flag"),
tag.getBoolean("hasTE") ? tag.getCompoundTag("tileEntity") : null);
tag.getInt("metadata"),
tag.getInt("flag"),
tag.getBoolean("hasTE") ? tag.getCompound("tileEntity") : null);
}
@Nullable
@ -126,7 +126,7 @@ public class BlockSnapshot
{
if (te == null) return null;
NBTTagCompound nbt = new NBTTagCompound();
te.writeToNBT(nbt);
te.write(nbt);
return nbt;
}
@ -150,7 +150,7 @@ public class BlockSnapshot
{
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;
}
@ -158,7 +158,7 @@ public class BlockSnapshot
@Nullable
public TileEntity getTileEntity()
{
return getNbt() != null ? TileEntity.func_203403_c(getNbt()) : null;
return getNbt() != null ? TileEntity.create(getNbt()) : null;
}
public boolean restore()
@ -202,7 +202,7 @@ public class BlockSnapshot
te = world.getTileEntity(pos);
if (te != null)
{
te.readFromNBT(getNbt());
te.read(getNbt());
te.markDirty();
}
}
@ -218,12 +218,12 @@ public class BlockSnapshot
{
compound.setString("blockMod", getRegistryName().getNamespace());
compound.setString("blockName", getRegistryName().getPath());
compound.setInteger("posX", getPos().getX());
compound.setInteger("posY", getPos().getY());
compound.setInteger("posZ", getPos().getZ());
compound.setInteger("flag", getFlag());
compound.setInteger("dimension", getDimId());
compound.setInteger("metadata", getMeta());
compound.setInt("posX", getPos().getX());
compound.setInt("posY", getPos().getY());
compound.setInt("posZ", getPos().getZ());
compound.setInt("flag", getFlag());
compound.setInt("dimension", getDimId());
compound.setInt("metadata", getMeta());
compound.setBoolean("hasTE", getNbt() != null);

View File

@ -77,4 +77,4 @@ public class ChunkCoordComparator implements java.util.Comparator<ChunkPos>
}
}
}
}
}

View File

@ -29,7 +29,7 @@ public class Constants
* NBT Tag type IDS, used when storing the nbt to disc, Should align with NBTBase.getId,
* 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

View File

@ -38,7 +38,7 @@ public class FakePlayer extends EntityPlayerMP
{
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); }
@ -46,10 +46,10 @@ public class FakePlayer extends EntityPlayerMP
@Override public void sendMessage(ITextComponent component) {}
@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 boolean isEntityInvulnerable(DamageSource source){ return true; }
@Override public boolean isInvulnerableTo(DamageSource source){ return true; }
@Override public boolean canAttackPlayer(EntityPlayer player){ return false; }
@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 void handleClientSettings(CPacketClientSettings pkt){ return; }
}

View File

@ -49,7 +49,7 @@ public class PacketUtil
if (stack.getItem().isDamageable() || stack.getItem().getShareTag())
{
nbttagcompound = stack.getTagCompound();
nbttagcompound = stack.getTag();
}
buffer.writeCompoundTag(nbttagcompound);

View File

@ -44,7 +44,7 @@ public class WorldCapabilityData extends WorldSavedData
}
@Override
public void readFromNBT(NBTTagCompound nbt)
public void read(NBTTagCompound nbt)
{
this.capNBT = nbt;
if (serializable != null)
@ -55,7 +55,7 @@ public class WorldCapabilityData extends WorldSavedData
}
@Override
public NBTTagCompound writeToNBT(NBTTagCompound nbt)
public NBTTagCompound write(NBTTagCompound nbt)
{
if (serializable != null)
nbt = serializable.serializeNBT();

View File

@ -57,4 +57,4 @@ public class DifficultyChangeEvent extends net.minecraftforge.eventbus.api.Event
{
return oldDifficulty;
}
}
}

View File

@ -384,7 +384,7 @@ public class ForgeEventFactory
if (event.getResult() == Result.ALLOW)
{
if (player.capabilities.isCreativeMode)
if (player.abilities.isCreativeMode)
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
stack.shrink(1);
@ -499,7 +499,7 @@ public class ForgeEventFactory
{
Entity e = itr.next();
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));

View File

@ -51,4 +51,4 @@ public class EntityTravelToDimensionEvent extends EntityEvent
{
return dimension;
}
}
}

View File

@ -50,4 +50,4 @@ public class ItemEvent extends EntityEvent
{
return entityItem;
}
}
}

View File

@ -55,4 +55,4 @@ public class ItemExpireEvent extends ItemEvent
{
this.extraLife = extraLife;
}
}
}

View File

@ -54,4 +54,4 @@ public class ItemTossEvent extends ItemEvent
{
return player;
}
}
}

View File

@ -58,4 +58,4 @@ public class LivingHealEvent extends LivingEvent
{
this.amount = amount;
}
}
}

View File

@ -92,4 +92,4 @@ public class LivingKnockBackEvent extends LivingEvent
public void setRatioX(double ratioX) {this.ratioX = ratioX;}
public void setRatioZ(double ratioZ) {this.ratioZ = ratioZ;}
}
}

Some files were not shown because too many files have changed in this diff Show More