diff --git a/game/client/src/main/java/net/minecraft/client/gui/achievements/ScreenAchievements.java b/game/client/src/main/java/net/minecraft/client/gui/achievements/ScreenAchievements.java index ca52ae79e..8485dd9dc 100644 --- a/game/client/src/main/java/net/minecraft/client/gui/achievements/ScreenAchievements.java +++ b/game/client/src/main/java/net/minecraft/client/gui/achievements/ScreenAchievements.java @@ -9,7 +9,6 @@ import net.minecraft.client.gui.achievements.data.AchievementPageRegistry; import net.minecraft.client.gui.achievements.data.AchievementPages; import net.minecraft.client.gui.options.OptionsButtonElement; import net.minecraft.client.render.Lighting; -import net.minecraft.client.render.LightmapHelper; import net.minecraft.client.render.Scissor; import net.minecraft.client.render.item.model.ItemModelDispatcher; import net.minecraft.client.render.renderer.BlendFactor; @@ -25,6 +24,7 @@ import net.minecraft.client.render.tessellator.TessellatorGeneral; import net.minecraft.core.achievement.Achievement; import net.minecraft.core.achievement.stat.StatsCounter; import net.minecraft.core.item.Item; +import net.minecraft.core.item.ItemStack; import net.minecraft.core.lang.I18n; import net.minecraft.core.net.command.TextFormatting; import net.minecraft.core.sound.SoundCategory; @@ -884,12 +884,12 @@ public class ScreenAchievements extends Screen GLRenderer.pushFrame(); GLRenderer.globalSetLightEnabled(true); GLRenderer.enableState(State.CULL_FACE); - Item achievementItem = Item.itemsList[ach.iconItemId]; + ItemStack achievementItem = ach.iconStack; GLRenderer.modelM4f().translate((float) (achViewX + 3 * zoom), (float) (achViewY + 3 * zoom), 0); GLRenderer.modelM4f().scale((float) zoom, (float) zoom, 1); // ItemModelDispatcher.getInstance().getDispatch(achievementItem).renderItemIntoGui(GLRenderer.getTessellator(), mc.font, mc.textureManager, achievementItem.getDefaultStack(), 0, 0, 1.0f); - ItemModelDispatcher.getInstance().getDispatch(achievementItem).renderGui(GLRenderer.getTessellator(), null, achievementItem.getDefaultStack(), 0, 0, LightIndexHelper.lightIndex2i(15, 15), 1f); + ItemModelDispatcher.getInstance().getDispatch(achievementItem).renderGui(GLRenderer.getTessellator(), null, achievementItem, 0, 0, LightIndexHelper.lightIndex2i(15, 15), 1f); GLRenderer.globalSetLightEnabled(false); GLRenderer.popFrame(); @@ -926,7 +926,7 @@ public class ScreenAchievements extends Screen boxRender = this.tooltip.drawBackground(mouseX, mouseY, TOOLTIP_OFF_X, TOOLTIP_OFF_Y, boxWidth + 3, boxHeight + 3 + 12); this.fontRenderer.renderWidthConstrained(msg, boxRender[0] + padding, boxRender[1] + 12 + padding, boxWidth).setColor(0xff705050).call(); } - int color = this.statsCounter.canUnlock(achievement) ? achievement.getType().colorName : achievement.getType().colorNameLocked; + int color = this.statsCounter.canUnlock(achievement) ? achievement.getType().colorName() : achievement.getType().colorNameLocked(); drawStringShadow(this.fontRenderer, name, boxRender[0] + padding, boxRender[1] + padding, color); } public boolean drawSidebar(){ diff --git a/game/client/src/main/java/net/minecraft/client/gui/achievements/pages/AchievementPageNether.java b/game/client/src/main/java/net/minecraft/client/gui/achievements/pages/AchievementPageNether.java index 264f94275..3353e308d 100644 --- a/game/client/src/main/java/net/minecraft/client/gui/achievements/pages/AchievementPageNether.java +++ b/game/client/src/main/java/net/minecraft/client/gui/achievements/pages/AchievementPageNether.java @@ -106,7 +106,7 @@ public class AchievementPageNether extends AchievementPage { @Override public IconCoordinate getAchievementIcon(Achievement achievement) { - return TextureRegistry.getTexture(achievement.getType().texture); + return TextureRegistry.getTexture(achievement.getType().texture()); } @Override diff --git a/game/client/src/main/java/net/minecraft/client/gui/achievements/pages/AchievementPageOverworld.java b/game/client/src/main/java/net/minecraft/client/gui/achievements/pages/AchievementPageOverworld.java index 8ab77a790..7db6d7a51 100644 --- a/game/client/src/main/java/net/minecraft/client/gui/achievements/pages/AchievementPageOverworld.java +++ b/game/client/src/main/java/net/minecraft/client/gui/achievements/pages/AchievementPageOverworld.java @@ -125,7 +125,7 @@ public class AchievementPageOverworld extends AchievementPage { for (int rY = y; rY - orgY >= 0; rY--) { if (rY == y) { - layer.put(TextureRegistry.getTexture("minecraft:block/grass/side"), _x - orgX, rY - orgY); + layer.put(TextureRegistry.getTexture("minecraft:block/grass/side_colored_achievement"), _x - orgX, rY - orgY); // TODO, need to evaluate how to properly implement colorations into the achievement background } else { layer.put(null, _x - orgX, rY - orgY); } @@ -309,7 +309,7 @@ public class AchievementPageOverworld extends AchievementPage { @Override public IconCoordinate getAchievementIcon(Achievement achievement) { - return TextureRegistry.getTexture(achievement.getType().texture); + return TextureRegistry.getTexture(achievement.getType().texture()); } @Override diff --git a/game/client/src/main/java/net/minecraft/client/gui/container/ScreenActivator.java b/game/client/src/main/java/net/minecraft/client/gui/container/ScreenActivator.java index 1aa3ea217..57075ada5 100644 --- a/game/client/src/main/java/net/minecraft/client/gui/container/ScreenActivator.java +++ b/game/client/src/main/java/net/minecraft/client/gui/container/ScreenActivator.java @@ -91,7 +91,7 @@ public class ScreenActivator extends ScreenContainerAbstract { @Override protected void mousePressed(int x, int y, @Nullable Slot slot, int button) { if (button != 1 || super.isDragging() || - super.getGrabbedItem() != null || slot == null || slot.getItemStack() != null + super.getGrabbedItem() != null || (slot != null && slot.getItemStack() != null) ) { super.mousePressed(x, y, slot, button); return; diff --git a/game/client/src/main/java/net/minecraft/client/gui/options/components/AvailableTexturePackListComponent.java b/game/client/src/main/java/net/minecraft/client/gui/options/components/AvailableTexturePackListComponent.java index 9265f6782..3a6bc2003 100644 --- a/game/client/src/main/java/net/minecraft/client/gui/options/components/AvailableTexturePackListComponent.java +++ b/game/client/src/main/java/net/minecraft/client/gui/options/components/AvailableTexturePackListComponent.java @@ -175,19 +175,21 @@ public class AvailableTexturePackListComponent int rgbVersion = 0x808080; int format = this.texturePack.manifest.getFormat(); + int minFormat = this.texturePack.manifest.getMinFormat(); + int maxFormat = this.texturePack.manifest.getMaxFormat(); - if(format == Global.ASSET_PACK_FORMAT) { - // Correct version - mc.font.render(this.texturePack.manifest.getName(), x + this.height + 2, y + 1).call(); + if(format == -1) { + // Manifest error + mc.font.render(TextFormatting.RED + this.texturePack.manifest.getName(), x + this.height + 2, y + 1).call(); mc.font.render(this.texturePack.manifest.getDescriptionLine1(), x + this.height + 2, y + 12).setColor(0x808080).call(); mc.font.render(this.texturePack.manifest.getDescriptionLine2(), x + this.height + 2, y + 22).setColor(0x808080).call(); - }else if(format == -1) { - // Manifest error - mc.font.render(TextFormatting.RED + this.texturePack.manifest.getName(), x + this.height + 2, y + 1).call(); + rgbVersion = Colors.allChatColors[TextFormatting.RED.id].getARGB(); + } else if(minFormat <= Global.ASSET_PACK_FORMAT && Global.ASSET_PACK_FORMAT <= maxFormat) { + // Correct version + mc.font.render(this.texturePack.manifest.getName(), x + this.height + 2, y + 1).call(); mc.font.render(this.texturePack.manifest.getDescriptionLine1(), x + this.height + 2, y + 12).setColor(0x808080).call(); mc.font.render(this.texturePack.manifest.getDescriptionLine2(), x + this.height + 2, y + 22).setColor(0x808080).call(); - rgbVersion = Colors.allChatColors[TextFormatting.RED.id].getARGB(); - }else { + } else { // Wrong texture pack version I18n i18n = I18n.getInstance(); mc.font.render(TextFormatting.RED + this.texturePack.manifest.getName(), x + this.height + 2, y + 1).call(); diff --git a/game/client/src/main/java/net/minecraft/client/gui/options/components/SelectedTexturePackListComponent.java b/game/client/src/main/java/net/minecraft/client/gui/options/components/SelectedTexturePackListComponent.java index 0a8b892cc..d86dd3efe 100644 --- a/game/client/src/main/java/net/minecraft/client/gui/options/components/SelectedTexturePackListComponent.java +++ b/game/client/src/main/java/net/minecraft/client/gui/options/components/SelectedTexturePackListComponent.java @@ -283,18 +283,20 @@ public class SelectedTexturePackListComponent implements OptionsComponent { int rgbVersion = 0x808080; int format = this.texturePack.manifest.getFormat(); + int minFormat = this.texturePack.manifest.getMinFormat(); + int maxFormat = this.texturePack.manifest.getMaxFormat(); - if (format == Global.ASSET_PACK_FORMAT) { - // Correct version - mc.font.render(this.texturePack.manifest.getName(), x + this.xPos + this.height + 2, y + this.yPos + 1).call(); - mc.font.render(this.texturePack.manifest.getDescriptionLine1(), x + this.xPos + this.height + 2, y + this.yPos + 12).setColor(0x808080).call(); - mc.font.render(this.texturePack.manifest.getDescriptionLine2(), x + this.xPos + this.height + 2, y + this.yPos + 22).setColor(0x808080).call(); - } else if (format == -1) { + if (format == -1) { // Manifest error mc.font.render(TextFormatting.RED + this.texturePack.manifest.getName(), x + this.xPos + this.height + 2, y + this.yPos + 1).call(); mc.font.render(this.texturePack.manifest.getDescriptionLine1(), x + this.xPos + this.height + 2, y + this.yPos + 12).setColor(0x808080).call(); mc.font.render(this.texturePack.manifest.getDescriptionLine2(), x + this.xPos + this.height + 2, y + this.yPos + 22).setColor(0x808080).call(); rgbVersion = Colors.allChatColors[TextFormatting.RED.id].getARGB(); + } else if(minFormat <= Global.ASSET_PACK_FORMAT && Global.ASSET_PACK_FORMAT <= maxFormat) { + // Correct version + mc.font.render(this.texturePack.manifest.getName(), x + this.xPos + this.height + 2, y + this.yPos + 1).call(); + mc.font.render(this.texturePack.manifest.getDescriptionLine1(), x + this.xPos + this.height + 2, y + this.yPos + 12).setColor(0x808080).call(); + mc.font.render(this.texturePack.manifest.getDescriptionLine2(), x + this.xPos + this.height + 2, y + this.yPos + 22).setColor(0x808080).call(); } else { // Wrong texture pack version I18n i18n = I18n.getInstance(); diff --git a/game/client/src/main/java/net/minecraft/client/gui/toasts/AchievementToast.java b/game/client/src/main/java/net/minecraft/client/gui/toasts/AchievementToast.java index 3b4610a6d..d7171c5a1 100644 --- a/game/client/src/main/java/net/minecraft/client/gui/toasts/AchievementToast.java +++ b/game/client/src/main/java/net/minecraft/client/gui/toasts/AchievementToast.java @@ -92,7 +92,7 @@ public class AchievementToast implements IToastable { @Override public @Nullable ItemStack getIcon(long runtime) { - return Item.getItem(achievement.iconItemId).getDefaultStack(); + return achievement.iconStack; } } diff --git a/game/client/src/main/java/net/minecraft/client/render/RenderGlobal.java b/game/client/src/main/java/net/minecraft/client/render/RenderGlobal.java index dd3b77653..4093a4acd 100644 --- a/game/client/src/main/java/net/minecraft/client/render/RenderGlobal.java +++ b/game/client/src/main/java/net/minecraft/client/render/RenderGlobal.java @@ -74,7 +74,7 @@ import java.util.Random; import static java.awt.Color.HSBtoRGB; -public class RenderGlobal +public final class RenderGlobal implements LevelListener { public static IconCoordinate[] breakingAnimation = new IconCoordinate[10]; @@ -937,27 +937,36 @@ public class RenderGlobal GLRenderer.disableState(State.CULL_FACE); float cameraY = (float) this.mc.activeCamera.getY(partialTick); TessellatorShader tessellator = GLRenderer.getTessellator(); - float cloudWidth = 12F; - float cloudThickness = 4F; - double dx = (this.mc.activeCamera.getX(partialTick) + (double) ((this.lastCloudOffsetX + (this.cloudOffsetX - this.lastCloudOffsetX) * partialTick) * 0.03F)) / (double) cloudWidth; - double dz = (this.mc.activeCamera.getZ(partialTick) + (double) ((this.lastCloudOffsetZ + (this.cloudOffsetZ - this.lastCloudOffsetZ) * partialTick) * 0.03F)) / (double) cloudWidth + 0.33D; - float dy = (worldTypeFX.getCloudHeight(world) - cameraY) + 0.33F + getCloudHeightModifier(); - int i = MathHelper.floor(dx / 2048D); - int j = MathHelper.floor(dz / 2048D); - dx -= i * 2048; - dz -= j * 2048; + float ss = 12F; + float h = 4F; + double xo = (this.mc.activeCamera.getX(partialTick) + (double) ((this.lastCloudOffsetX + (this.cloudOffsetX - this.lastCloudOffsetX) * partialTick) * 0.03F)) / (double) ss; + double zo = (this.mc.activeCamera.getZ(partialTick) + (double) ((this.lastCloudOffsetZ + (this.cloudOffsetZ - this.lastCloudOffsetZ) * partialTick) * 0.03F)) / (double) ss + 0.33D; + float yy = (worldTypeFX.getCloudHeight(this.world) - cameraY) + 0.33F + getCloudHeightModifier(); + int xOffs = MathHelper.floor(xo / 2048D); + int zOffs = MathHelper.floor(zo / 2048D); + xo -= xOffs * 2048; + zo -= zOffs * 2048; + + boolean noBFCMode = ( (yy > -h - 1) && (yy <= h + 1) ); + if( noBFCMode ) { + GLRenderer.disableState(State.CULL_FACE); + } + else { + GLRenderer.enableState(State.CULL_FACE); + } + this.textureManager.loadTexture("/assets/minecraft/textures/environment/clouds.png").bind(); GLRenderer.enableState(State.BLEND); GLRenderer.setBlendFunc(BlendFactor.SRC_ALPHA, BlendFactor.ONE_MINUS_SRC_ALPHA); - float f13 = 1F / 256F; - float f9 = (float) MathHelper.floor(dx) * f13; - float f11 = (float) MathHelper.floor(dz) * f13; - float f14 = (float) (dx - (double) MathHelper.floor(dx)); - float f15 = (float) (dz - (double) MathHelper.floor(dz)); - final int cloudWidthScale = 8; + float scale = 1F / 256F; + float uo = (float) MathHelper.floor(xo) * scale; + float vo = (float) MathHelper.floor(zo) * scale; + float xoffs2 = (float) (xo - (double) MathHelper.floor(xo)); + float zoffs2 = (float) (zo - (double) MathHelper.floor(zo)); + final int D = 8; final byte radius = (byte) Math.max(1, 3 * GameSettings.CLOUD_RENDER_DISTANCE.value); - float f16 = 1F / 1024F; - GLRenderer.modelM4f().scale(cloudWidth, 1.0F, cloudWidth); + float e = 1F / 1024F; + GLRenderer.modelM4f().scale(ss, 1.0F, ss); float red = rDim + (rSun - rDim) * aSun; float green = gDim + (gSun - gDim) * aSun; @@ -965,75 +974,80 @@ public class RenderGlobal tessellator.startDrawingQuads(); { - float width = (radius * 2 + 2) * cloudWidthScale; - float minX = (-radius - 1) * cloudWidthScale; - float minZ = (-radius - 1) * cloudWidthScale; - float cloudX = minX - f14; - float cloudZ = minZ - f15; - if (dy > -cloudThickness - 1.0F) { + float width = (radius * 2 + 2) * D; + float xx = (-radius - 1) * D; + float zz = (-radius - 1) * D; + float xp = xx - xoffs2; + float zp = zz - zoffs2; + if (yy > -h - 1.0F) { tessellator.setColor4f(red * 0.7F, green * 0.7F, blue * 0.7F, 0.8F); tessellator.setNormal(0.0F, -1F, 0.0F); - tessellator.addVertexWithUV(cloudX + 0.0F, dy + 0.0F, cloudZ + width, (minX + 0.0F) * f13 + f9, (minZ + width) * f13 + f11); - tessellator.addVertexWithUV(cloudX + width, dy + 0.0F, cloudZ + width, (minX + width) * f13 + f9, (minZ + width) * f13 + f11); - tessellator.addVertexWithUV(cloudX + width, dy + 0.0F, cloudZ + 0.0F, (minX + width) * f13 + f9, (minZ + 0.0F) * f13 + f11); - tessellator.addVertexWithUV(cloudX + 0.0F, dy + 0.0F, cloudZ + 0.0F, (minX + 0.0F) * f13 + f9, (minZ + 0.0F) * f13 + f11); + tessellator.addVertexWithUV(xp + 0.0F, yy + 0.0F, zp + 0.0F, (xx + 0.0F) * scale + uo, (zz + 0.0F) * scale + vo); + tessellator.addVertexWithUV(xp + width, yy + 0.0F, zp + 0.0F, (xx + width) * scale + uo, (zz + 0.0F) * scale + vo); + tessellator.addVertexWithUV(xp + width, yy + 0.0F, zp + width, (xx + width) * scale + uo, (zz + width) * scale + vo); + tessellator.addVertexWithUV(xp + 0.0F, yy + 0.0F, zp + width, (xx + 0.0F) * scale + uo, (zz + width) * scale + vo); } - if (dy <= cloudThickness + 1.0F) { + if (yy <= h + 1.0F) { tessellator.setColor4f(red, green, blue, 0.8F); tessellator.setNormal(0.0F, 1.0F, 0.0F); - tessellator.addVertexWithUV(cloudX + 0.0F, (dy + cloudThickness) - f16, cloudZ + width, (minX + 0.0F) * f13 + f9, (minZ + width) * f13 + f11); - tessellator.addVertexWithUV(cloudX + width, (dy + cloudThickness) - f16, cloudZ + width, (minX + width) * f13 + f9, (minZ + width) * f13 + f11); - tessellator.addVertexWithUV(cloudX + width, (dy + cloudThickness) - f16, cloudZ + 0.0F, (minX + width) * f13 + f9, (minZ + 0.0F) * f13 + f11); - tessellator.addVertexWithUV(cloudX + 0.0F, (dy + cloudThickness) - f16, cloudZ + 0.0F, (minX + 0.0F) * f13 + f9, (minZ + 0.0F) * f13 + f11); + tessellator.addVertexWithUV(xp + 0.0F, (yy + h) - e, zp + 0.0F, (xx + 0.0F) * scale + uo, (zz + 0.0F) * scale + vo); + tessellator.addVertexWithUV(xp + 0.0F, (yy + h) - e, zp + width, (xx + 0.0F) * scale + uo, (zz + width) * scale + vo); + tessellator.addVertexWithUV(xp + width, (yy + h) - e, zp + width, (xx + width) * scale + uo, (zz + width) * scale + vo); + tessellator.addVertexWithUV(xp + width, (yy + h) - e, zp + 0.0F, (xx + width) * scale + uo, (zz + 0.0F) * scale + vo); } } for (int ix = -radius - 1; ix <= radius + 1; ix++) { for (int iz = -radius - 1; iz <= radius + 1; iz++) { - - float f17 = ix * cloudWidthScale; - float f18 = iz * cloudWidthScale; - float cloudX = f17 - f14; - float cloudZ = f18 - f15; + float xx = ix * D; + float zz = iz * D; + float cloudX = xx - xoffs2; + float cloudZ = zz - zoffs2; tessellator.setColor4f(red * 0.9F, green * 0.9F, blue * 0.9F, 0.8F); if (ix > -1) { tessellator.setNormal(-1F, 0.0F, 0.0F); - for (int k1 = 0; k1 < cloudWidthScale; k1++) { - tessellator.addVertexWithUV(cloudX + (float) k1 + 0.0F, dy + 0.0F, cloudZ + (float) cloudWidthScale, (f17 + (float) k1 + 0.5F) * f13 + f9, (f18 + (float) cloudWidthScale) * f13 + f11); - tessellator.addVertexWithUV(cloudX + (float) k1 + 0.0F, dy + cloudThickness, cloudZ + (float) cloudWidthScale, (f17 + (float) k1 + 0.5F) * f13 + f9, (f18 + (float) cloudWidthScale) * f13 + f11); - tessellator.addVertexWithUV(cloudX + (float) k1 + 0.0F, dy + cloudThickness, cloudZ + 0.0F, (f17 + (float) k1 + 0.5F) * f13 + f9, (f18 + 0.0F) * f13 + f11); - tessellator.addVertexWithUV(cloudX + (float) k1 + 0.0F, dy + 0.0F, cloudZ + 0.0F, (f17 + (float) k1 + 0.5F) * f13 + f9, (f18 + 0.0F) * f13 + f11); + for (int s = 0; s < D; s++) { + final float u = (xx + s + 0.5F) * scale + uo; + tessellator.addVertexWithUV(cloudX + s + 0.0F, yy + 0.0F, cloudZ + 0.0F, u, (zz + 0.0F) * scale + vo); + tessellator.addVertexWithUV(cloudX + s + 0.0F, yy + 0.0F, cloudZ + D, u, (zz + D) * scale + vo); + tessellator.addVertexWithUV(cloudX + s + 0.0F, yy + h, cloudZ + D, u, (zz + D) * scale + vo); + tessellator.addVertexWithUV(cloudX + s + 0.0F, yy + h, cloudZ + 0.0F, u, (zz + 0.0F) * scale + vo); } + } - } else { + if (ix <= 1) { tessellator.setNormal(1.0F, 0.0F, 0.0F); - for (int l1 = 0; l1 < cloudWidthScale; l1++) { - tessellator.addVertexWithUV((cloudX + (float) l1 + 1.0F) - f16, dy + 0.0F, cloudZ + (float) cloudWidthScale, (f17 + (float) l1 + 0.5F) * f13 + f9, (f18 + (float) cloudWidthScale) * f13 + f11); - tessellator.addVertexWithUV((cloudX + (float) l1 + 1.0F) - f16, dy + cloudThickness, cloudZ + (float) cloudWidthScale, (f17 + (float) l1 + 0.5F) * f13 + f9, (f18 + (float) cloudWidthScale) * f13 + f11); - tessellator.addVertexWithUV((cloudX + (float) l1 + 1.0F) - f16, dy + cloudThickness, cloudZ + 0.0F, (f17 + (float) l1 + 0.5F) * f13 + f9, (f18 + 0.0F) * f13 + f11); - tessellator.addVertexWithUV((cloudX + (float) l1 + 1.0F) - f16, dy + 0.0F, cloudZ + 0.0F, (f17 + (float) l1 + 0.5F) * f13 + f9, (f18 + 0.0F) * f13 + f11); + for (int s = 0; s < D; s++) { + final float u = (xx + s + 0.5F) * scale + uo; + tessellator.addVertexWithUV((cloudX + s + 1.0F) - e, yy + 0.0F, cloudZ + 0.0F, u, (zz + 0.0F) * scale + vo); + tessellator.addVertexWithUV((cloudX + s + 1.0F) - e, yy + h, cloudZ + 0.0F, u, (zz + 0.0F) * scale + vo); + tessellator.addVertexWithUV((cloudX + s + 1.0F) - e, yy + h, cloudZ + D, u, (zz + D) * scale + vo); + tessellator.addVertexWithUV((cloudX + s + 1.0F) - e, yy + 0.0F, cloudZ + D, u, (zz + D) * scale + vo); } - } + tessellator.setColor4f(red * 0.8F, green * 0.8F, blue * 0.8F, 0.8F); + tessellator.setNormal(0.0F, 0.0F, -1F); if (iz > -1) { - tessellator.setNormal(0.0F, 0.0F, -1F); - for (int i2 = 0; i2 < cloudWidthScale; i2++) { - tessellator.addVertexWithUV(cloudX + 0.0F, dy + cloudThickness, cloudZ + (float) i2 + 0.0F, (f17 + 0.0F) * f13 + f9, (f18 + (float) i2 + 0.5F) * f13 + f11); - tessellator.addVertexWithUV(cloudX + (float) cloudWidthScale, dy + cloudThickness, cloudZ + (float) i2 + 0.0F, (f17 + (float) cloudWidthScale) * f13 + f9, (f18 + (float) i2 + 0.5F) * f13 + f11); - tessellator.addVertexWithUV(cloudX + (float) cloudWidthScale, dy + 0.0F, cloudZ + (float) i2 + 0.0F, (f17 + (float) cloudWidthScale) * f13 + f9, (f18 + (float) i2 + 0.5F) * f13 + f11); - tessellator.addVertexWithUV(cloudX + 0.0F, dy + 0.0F, cloudZ + (float) i2 + 0.0F, (f17 + 0.0F) * f13 + f9, (f18 + (float) i2 + 0.5F) * f13 + f11); + for (int s = 0; s < D; s++) { + final float v = (zz + s + 0.5F) * scale + vo; + tessellator.addVertexWithUV(cloudX + 0.0F, yy + 0.0F, cloudZ + s + 0.0F, (xx + 0.0F) * scale + uo, v); + tessellator.addVertexWithUV(cloudX + 0.0F, yy + h, cloudZ + s + 0.0F, (xx + 0.0F) * scale + uo, v); + tessellator.addVertexWithUV(cloudX + D, yy + h, cloudZ + s + 0.0F, (xx + D) * scale + uo, v); + tessellator.addVertexWithUV(cloudX + D, yy + 0.0F, cloudZ + s + 0.0F, (xx + D) * scale + uo, v); } + } - } else { - tessellator.setNormal(0.0F, 0.0F, 1.0F); - for (int j2 = 0; j2 < cloudWidthScale; j2++) { - tessellator.addVertexWithUV(cloudX + 0.0F, dy + cloudThickness, (cloudZ + (float) j2 + 1.0F) - f16, (f17 + 0.0F) * f13 + f9, (f18 + (float) j2 + 0.5F) * f13 + f11); - tessellator.addVertexWithUV(cloudX + (float) cloudWidthScale, dy + cloudThickness, (cloudZ + (float) j2 + 1.0F) - f16, (f17 + (float) cloudWidthScale) * f13 + f9, (f18 + (float) j2 + 0.5F) * f13 + f11); - tessellator.addVertexWithUV(cloudX + (float) cloudWidthScale, dy + 0.0F, (cloudZ + (float) j2 + 1.0F) - f16, (f17 + (float) cloudWidthScale) * f13 + f9, (f18 + (float) j2 + 0.5F) * f13 + f11); - tessellator.addVertexWithUV(cloudX + 0.0F, dy + 0.0F, (cloudZ + (float) j2 + 1.0F) - f16, (f17 + 0.0F) * f13 + f9, (f18 + (float) j2 + 0.5F) * f13 + f11); + tessellator.setNormal(0.0F, 0.0F, 1.0F); + if (iz <= 1) { + for (int s = 0; s < D; s++) { + final float v = (zz + s + 0.5F) * scale + vo; + tessellator.addVertexWithUV(cloudX + 0.0, yy + 0.0, (cloudZ + s + 1.0) - e, (xx + 0.0) * scale + uo, v); + tessellator.addVertexWithUV(cloudX + D, yy + 0.0, (cloudZ + s + 1.0) - e, (xx + D) * scale + uo, v); + tessellator.addVertexWithUV(cloudX + D, yy + h, (cloudZ + s + 1.0) - e, (xx + D) * scale + uo, v); + tessellator.addVertexWithUV(cloudX + 0., yy + h, (cloudZ + s + 1.0) - e, (xx + 0.0) * scale + uo, v); } - } + } } diff --git a/game/client/src/main/java/net/minecraft/client/render/block/model/BlockModelDispatcher.java b/game/client/src/main/java/net/minecraft/client/render/block/model/BlockModelDispatcher.java index b65bbd6c7..0a10aed30 100644 --- a/game/client/src/main/java/net/minecraft/client/render/block/model/BlockModelDispatcher.java +++ b/game/client/src/main/java/net/minecraft/client/render/block/model/BlockModelDispatcher.java @@ -240,7 +240,7 @@ public final class BlockModelDispatcher addDispatch(new BlockModelGeneric<>(Blocks.GRAVEL, loadDataModel("minecraft:block/gravel"))); addDispatch(new BlockModelGeneric<>(Blocks.BRIMSAND, loadDataModel("minecraft:block/brimsand"))); - addDispatch(new BlockModelGeneric<>(Blocks.BEDROCK, loadDataModel("minecraft:block/bedrock"))); + addDispatch(new BlockModelGenericCullBounderies<>(Blocks.BEDROCK, loadDataModel("minecraft:block/bedrock"))); addDispatch(new BlockModelGenericFullyRotatable<>(Blocks.BONESHALE, loadDataModel("minecraft:block/bone_shale"))); diff --git a/game/client/src/main/java/net/minecraft/client/render/block/model/BlockModelWireRedstone.java b/game/client/src/main/java/net/minecraft/client/render/block/model/BlockModelWireRedstone.java index 739f76c45..263d8f18f 100644 --- a/game/client/src/main/java/net/minecraft/client/render/block/model/BlockModelWireRedstone.java +++ b/game/client/src/main/java/net/minecraft/client/render/block/model/BlockModelWireRedstone.java @@ -73,13 +73,13 @@ public class BlockModelWireRedstone extends BlockModelStan final int y = tilePos.y(); final int z = tilePos.z(); - float xMin = x; - float xMax = x + 1; - float zMin = z; - float zMax = z + 1; + double xMin = x; + double xMax = x + 1; + double zMin = z; + double zMax = z + 1; - final float onePix = 1f / 16; - final float renderOffset = 0.015625F; + final double onePix = 1f / 16; + final double renderOffset = 0.015625F; byte type = 0; @@ -99,99 +99,99 @@ public class BlockModelWireRedstone extends BlockModelStan if (type == 0) { if (amount != 0) { // Render Dot - float w = west ? 0 : onePix * 5; - float e = east ? 0 : onePix * 5; - float s = south ? 0 : onePix * 5; - float n = north ? 0 : onePix * 5; + double w = west ? 0 : onePix * 5; + double e = east ? 0 : onePix * 5; + double s = south ? 0 : onePix * 5; + double n = north ? 0 : onePix * 5; - tessellator.addVertexWithUV(xMax - e, (float) y + renderOffset, zMax - s, cross.getSubIconU(1 - e), cross.getSubIconV(1 - s)); - tessellator.addVertexWithUV(xMax - e, (float) y + renderOffset, zMin + n, cross.getSubIconU(1 - e), cross.getSubIconV(n)); - tessellator.addVertexWithUV(xMin + w, (float) y + renderOffset, zMin + n, cross.getSubIconU(w), cross.getSubIconV(n)); - tessellator.addVertexWithUV(xMin + w, (float) y + renderOffset, zMax - s, cross.getSubIconU(w), cross.getSubIconV(1 - s)); + tessellator.addVertexWithUV(xMax - e, y + renderOffset, zMax - s, cross.getSubIconU(1 - e), cross.getSubIconV(1 - s)); + tessellator.addVertexWithUV(xMax - e, y + renderOffset, zMin + n, cross.getSubIconU(1 - e), cross.getSubIconV(n)); + tessellator.addVertexWithUV(xMin + w, y + renderOffset, zMin + n, cross.getSubIconU(w), cross.getSubIconV(n)); + tessellator.addVertexWithUV(xMin + w, y + renderOffset, zMax - s, cross.getSubIconU(w), cross.getSubIconV(1 - s)); - tessellator.addVertexWithUV(xMax - e, (float) y + renderOffset, zMax - s, cross.getSubIconU(1 - e), cross.getSubIconV(1 - s)); - tessellator.addVertexWithUV(xMin + w, (float) y + renderOffset, zMax - s, cross.getSubIconU(w), cross.getSubIconV(1 - s)); - tessellator.addVertexWithUV(xMin + w, (float) y + renderOffset, zMin + n, cross.getSubIconU(w), cross.getSubIconV(n)); - tessellator.addVertexWithUV(xMax - e, (float) y + renderOffset, zMin + n, cross.getSubIconU(1 - e), cross.getSubIconV(n)); + tessellator.addVertexWithUV(xMax - e, y + renderOffset, zMax - s, cross.getSubIconU(1 - e), cross.getSubIconV(1 - s)); + tessellator.addVertexWithUV(xMin + w, y + renderOffset, zMax - s, cross.getSubIconU(w), cross.getSubIconV(1 - s)); + tessellator.addVertexWithUV(xMin + w, y + renderOffset, zMin + n, cross.getSubIconU(w), cross.getSubIconV(n)); + tessellator.addVertexWithUV(xMax - e, y + renderOffset, zMin + n, cross.getSubIconU(1 - e), cross.getSubIconV(n)); } else { - tessellator.addVertexWithUV(xMax, (float) y + renderOffset, zMax, cross.getIconUMax(), cross.getIconVMax()); - tessellator.addVertexWithUV(xMax, (float) y + renderOffset, zMin, cross.getIconUMax(), cross.getIconVMin()); - tessellator.addVertexWithUV(xMin, (float) y + renderOffset, zMin, cross.getIconUMin(), cross.getIconVMin()); - tessellator.addVertexWithUV(xMin, (float) y + renderOffset, zMax, cross.getIconUMin(), cross.getIconVMax()); - - tessellator.addVertexWithUV(xMax, (float) y + renderOffset, zMax, cross.getIconUMax(), cross.getIconVMax()); - tessellator.addVertexWithUV(xMin, (float) y + renderOffset, zMax, cross.getIconUMin(), cross.getIconVMax()); - tessellator.addVertexWithUV(xMin, (float) y + renderOffset, zMin, cross.getIconUMin(), cross.getIconVMin()); - tessellator.addVertexWithUV(xMax, (float) y + renderOffset, zMin, cross.getIconUMax(), cross.getIconVMin()); + tessellator.addVertexWithUV(xMax, y + renderOffset, zMax, cross.getIconUMax(), cross.getIconVMax()); + tessellator.addVertexWithUV(xMax, y + renderOffset, zMin, cross.getIconUMax(), cross.getIconVMin()); + tessellator.addVertexWithUV(xMin, y + renderOffset, zMin, cross.getIconUMin(), cross.getIconVMin()); + tessellator.addVertexWithUV(xMin, y + renderOffset, zMax, cross.getIconUMin(), cross.getIconVMax()); + + tessellator.addVertexWithUV(xMax, y + renderOffset, zMax, cross.getIconUMax(), cross.getIconVMax()); + tessellator.addVertexWithUV(xMin, y + renderOffset, zMax, cross.getIconUMin(), cross.getIconVMax()); + tessellator.addVertexWithUV(xMin, y + renderOffset, zMin, cross.getIconUMin(), cross.getIconVMin()); + tessellator.addVertexWithUV(xMax, y + renderOffset, zMin, cross.getIconUMax(), cross.getIconVMin()); } } else if (type == 1) { // East-West - tessellator.addVertexWithUV(xMax, (float) y + renderOffset, zMax, straight.getIconUMax(), straight.getIconVMax()); - tessellator.addVertexWithUV(xMax, (float) y + renderOffset, zMin, straight.getIconUMax(), straight.getIconVMin()); - tessellator.addVertexWithUV(xMin, (float) y + renderOffset, zMin, straight.getIconUMin(), straight.getIconVMin()); - tessellator.addVertexWithUV(xMin, (float) y + renderOffset, zMax, straight.getIconUMin(), straight.getIconVMax()); - - tessellator.addVertexWithUV(xMax, (float) y + renderOffset, zMax, straight.getIconUMax(), straight.getIconVMax()); - tessellator.addVertexWithUV(xMin, (float) y + renderOffset, zMax, straight.getIconUMin(), straight.getIconVMax()); - tessellator.addVertexWithUV(xMin, (float) y + renderOffset, zMin, straight.getIconUMin(), straight.getIconVMin()); - tessellator.addVertexWithUV(xMax, (float) y + renderOffset, zMin, straight.getIconUMax(), straight.getIconVMin()); + tessellator.addVertexWithUV(xMax, y + renderOffset, zMax, straight.getIconUMax(), straight.getIconVMax()); + tessellator.addVertexWithUV(xMax, y + renderOffset, zMin, straight.getIconUMax(), straight.getIconVMin()); + tessellator.addVertexWithUV(xMin, y + renderOffset, zMin, straight.getIconUMin(), straight.getIconVMin()); + tessellator.addVertexWithUV(xMin, y + renderOffset, zMax, straight.getIconUMin(), straight.getIconVMax()); + + tessellator.addVertexWithUV(xMax, y + renderOffset, zMax, straight.getIconUMax(), straight.getIconVMax()); + tessellator.addVertexWithUV(xMin, y + renderOffset, zMax, straight.getIconUMin(), straight.getIconVMax()); + tessellator.addVertexWithUV(xMin, y + renderOffset, zMin, straight.getIconUMin(), straight.getIconVMin()); + tessellator.addVertexWithUV(xMax, y + renderOffset, zMin, straight.getIconUMax(), straight.getIconVMin()); } else { // North-South - tessellator.addVertexWithUV(xMax, (float) y + renderOffset, zMax, straight.getIconUMax(), straight.getIconVMax()); - tessellator.addVertexWithUV(xMax, (float) y + renderOffset, zMin, straight.getIconUMin(), straight.getIconVMax()); - tessellator.addVertexWithUV(xMin, (float) y + renderOffset, zMin, straight.getIconUMin(), straight.getIconVMin()); - tessellator.addVertexWithUV(xMin, (float) y + renderOffset, zMax, straight.getIconUMax(), straight.getIconVMin()); - - tessellator.addVertexWithUV(xMax, (float) y + renderOffset, zMax, straight.getIconUMax(), straight.getIconVMax()); - tessellator.addVertexWithUV(xMin, (float) y + renderOffset, zMax, straight.getIconUMax(), straight.getIconVMin()); - tessellator.addVertexWithUV(xMin, (float) y + renderOffset, zMin, straight.getIconUMin(), straight.getIconVMin()); - tessellator.addVertexWithUV(xMax, (float) y + renderOffset, zMin, straight.getIconUMin(), straight.getIconVMax()); + tessellator.addVertexWithUV(xMax, y + renderOffset, zMax, straight.getIconUMax(), straight.getIconVMax()); + tessellator.addVertexWithUV(xMax, y + renderOffset, zMin, straight.getIconUMin(), straight.getIconVMax()); + tessellator.addVertexWithUV(xMin, y + renderOffset, zMin, straight.getIconUMin(), straight.getIconVMin()); + tessellator.addVertexWithUV(xMin, y + renderOffset, zMax, straight.getIconUMax(), straight.getIconVMin()); + + tessellator.addVertexWithUV(xMax, y + renderOffset, zMax, straight.getIconUMax(), straight.getIconVMax()); + tessellator.addVertexWithUV(xMin, y + renderOffset, zMax, straight.getIconUMax(), straight.getIconVMin()); + tessellator.addVertexWithUV(xMin, y + renderOffset, zMin, straight.getIconUMin(), straight.getIconVMin()); + tessellator.addVertexWithUV(xMax, y + renderOffset, zMin, straight.getIconUMin(), straight.getIconVMax()); } if (northUp) { - tessellator.addVertexWithUV(xMin, (float) y + 1, z + renderOffset, straight.getIconUMin(), straight.getIconVMin()); - tessellator.addVertexWithUV(xMin, (float) y, z + renderOffset, straight.getIconUMax(), straight.getIconVMin()); - tessellator.addVertexWithUV(xMax, (float) y, z + renderOffset, straight.getIconUMax(), straight.getIconVMax()); - tessellator.addVertexWithUV(xMax, (float) y + 1, z + renderOffset, straight.getIconUMin(), straight.getIconVMax()); - - tessellator.addVertexWithUV(xMin, (float) y + 1, z + renderOffset, straight.getIconUMin(), straight.getIconVMin()); - tessellator.addVertexWithUV(xMax, (float) y + 1, z + renderOffset, straight.getIconUMin(), straight.getIconVMax()); - tessellator.addVertexWithUV(xMax, (float) y, z + renderOffset, straight.getIconUMax(), straight.getIconVMax()); - tessellator.addVertexWithUV(xMin, (float) y, z + renderOffset, straight.getIconUMax(), straight.getIconVMin()); + tessellator.addVertexWithUV(xMin, y + 1, z + renderOffset, straight.getIconUMin(), straight.getIconVMin()); + tessellator.addVertexWithUV(xMin, y, z + renderOffset, straight.getIconUMax(), straight.getIconVMin()); + tessellator.addVertexWithUV(xMax, y, z + renderOffset, straight.getIconUMax(), straight.getIconVMax()); + tessellator.addVertexWithUV(xMax, y + 1, z + renderOffset, straight.getIconUMin(), straight.getIconVMax()); + + tessellator.addVertexWithUV(xMin, y + 1, z + renderOffset, straight.getIconUMin(), straight.getIconVMin()); + tessellator.addVertexWithUV(xMax, y + 1, z + renderOffset, straight.getIconUMin(), straight.getIconVMax()); + tessellator.addVertexWithUV(xMax, y, z + renderOffset, straight.getIconUMax(), straight.getIconVMax()); + tessellator.addVertexWithUV(xMin, y, z + renderOffset, straight.getIconUMax(), straight.getIconVMin()); } if (southUp) { - tessellator.addVertexWithUV(xMax, (float) y + 1, z + 1 - renderOffset, straight.getIconUMin(), straight.getIconVMax()); - tessellator.addVertexWithUV(xMax, (float) y, z + 1 - renderOffset, straight.getIconUMax(), straight.getIconVMax()); - tessellator.addVertexWithUV(xMin, (float) y, z + 1 - renderOffset, straight.getIconUMax(), straight.getIconVMin()); - tessellator.addVertexWithUV(xMin, (float) y + 1, z + 1 - renderOffset, straight.getIconUMin(), straight.getIconVMin()); - - tessellator.addVertexWithUV(xMax, (float) y + 1, z + 1 - renderOffset, straight.getIconUMin(), straight.getIconVMax()); - tessellator.addVertexWithUV(xMin, (float) y + 1, z + 1 - renderOffset, straight.getIconUMin(), straight.getIconVMin()); - tessellator.addVertexWithUV(xMin, (float) y, z + 1 - renderOffset, straight.getIconUMax(), straight.getIconVMin()); - tessellator.addVertexWithUV(xMax, (float) y, z + 1 - renderOffset, straight.getIconUMax(), straight.getIconVMax()); + tessellator.addVertexWithUV(xMax, y + 1, z + 1 - renderOffset, straight.getIconUMin(), straight.getIconVMax()); + tessellator.addVertexWithUV(xMax, y, z + 1 - renderOffset, straight.getIconUMax(), straight.getIconVMax()); + tessellator.addVertexWithUV(xMin, y, z + 1 - renderOffset, straight.getIconUMax(), straight.getIconVMin()); + tessellator.addVertexWithUV(xMin, y + 1, z + 1 - renderOffset, straight.getIconUMin(), straight.getIconVMin()); + + tessellator.addVertexWithUV(xMax, y + 1, z + 1 - renderOffset, straight.getIconUMin(), straight.getIconVMax()); + tessellator.addVertexWithUV(xMin, y + 1, z + 1 - renderOffset, straight.getIconUMin(), straight.getIconVMin()); + tessellator.addVertexWithUV(xMin, y, z + 1 - renderOffset, straight.getIconUMax(), straight.getIconVMin()); + tessellator.addVertexWithUV(xMax, y, z + 1 - renderOffset, straight.getIconUMax(), straight.getIconVMax()); } if (eastUp) { - tessellator.addVertexWithUV(x + 1 - renderOffset, (float) y + 1, zMin, straight.getIconUMin(), straight.getIconVMax()); - tessellator.addVertexWithUV(x + 1 - renderOffset, (float) y, zMin, straight.getIconUMax(), straight.getIconVMax()); - tessellator.addVertexWithUV(x + 1 - renderOffset, (float) y, zMax, straight.getIconUMax(), straight.getIconVMin()); - tessellator.addVertexWithUV(x + 1 - renderOffset, (float) y + 1, zMax, straight.getIconUMin(), straight.getIconVMin()); - - tessellator.addVertexWithUV(x + 1 - renderOffset, (float) y + 1, zMin, straight.getIconUMin(), straight.getIconVMax()); - tessellator.addVertexWithUV(x + 1 - renderOffset, (float) y + 1, zMax, straight.getIconUMin(), straight.getIconVMin()); - tessellator.addVertexWithUV(x + 1 - renderOffset, (float) y, zMax, straight.getIconUMax(), straight.getIconVMin()); - tessellator.addVertexWithUV(x + 1 - renderOffset, (float) y, zMin, straight.getIconUMax(), straight.getIconVMax()); + tessellator.addVertexWithUV(x + 1 - renderOffset, y + 1, zMin, straight.getIconUMin(), straight.getIconVMax()); + tessellator.addVertexWithUV(x + 1 - renderOffset, y, zMin, straight.getIconUMax(), straight.getIconVMax()); + tessellator.addVertexWithUV(x + 1 - renderOffset, y, zMax, straight.getIconUMax(), straight.getIconVMin()); + tessellator.addVertexWithUV(x + 1 - renderOffset, y + 1, zMax, straight.getIconUMin(), straight.getIconVMin()); + + tessellator.addVertexWithUV(x + 1 - renderOffset, y + 1, zMin, straight.getIconUMin(), straight.getIconVMax()); + tessellator.addVertexWithUV(x + 1 - renderOffset, y + 1, zMax, straight.getIconUMin(), straight.getIconVMin()); + tessellator.addVertexWithUV(x + 1 - renderOffset, y, zMax, straight.getIconUMax(), straight.getIconVMin()); + tessellator.addVertexWithUV(x + 1 - renderOffset, y, zMin, straight.getIconUMax(), straight.getIconVMax()); } if (westUp) { - tessellator.addVertexWithUV(x + renderOffset, (float) y + 1, zMin, straight.getIconUMin(), straight.getIconVMax()); - tessellator.addVertexWithUV(x + renderOffset, (float) y + 1, zMax, straight.getIconUMin(), straight.getIconVMin()); - tessellator.addVertexWithUV(x + renderOffset, (float) y, zMax, straight.getIconUMax(), straight.getIconVMin()); - tessellator.addVertexWithUV(x + renderOffset, (float) y, zMin, straight.getIconUMax(), straight.getIconVMax()); - - tessellator.addVertexWithUV(x + renderOffset, (float) y + 1, zMin, straight.getIconUMin(), straight.getIconVMax()); - tessellator.addVertexWithUV(x + renderOffset, (float) y, zMin, straight.getIconUMax(), straight.getIconVMax()); - tessellator.addVertexWithUV(x + renderOffset, (float) y, zMax, straight.getIconUMax(), straight.getIconVMin()); - tessellator.addVertexWithUV(x + renderOffset, (float) y + 1, zMax, straight.getIconUMin(), straight.getIconVMin()); + tessellator.addVertexWithUV(x + renderOffset, y + 1, zMin, straight.getIconUMin(), straight.getIconVMax()); + tessellator.addVertexWithUV(x + renderOffset, y + 1, zMax, straight.getIconUMin(), straight.getIconVMin()); + tessellator.addVertexWithUV(x + renderOffset, y, zMax, straight.getIconUMax(), straight.getIconVMin()); + tessellator.addVertexWithUV(x + renderOffset, y, zMin, straight.getIconUMax(), straight.getIconVMax()); + + tessellator.addVertexWithUV(x + renderOffset, y + 1, zMin, straight.getIconUMin(), straight.getIconVMax()); + tessellator.addVertexWithUV(x + renderOffset, y, zMin, straight.getIconUMax(), straight.getIconVMax()); + tessellator.addVertexWithUV(x + renderOffset, y, zMax, straight.getIconUMax(), straight.getIconVMin()); + tessellator.addVertexWithUV(x + renderOffset, y + 1, zMax, straight.getIconUMin(), straight.getIconVMin()); } return true; diff --git a/game/client/src/main/java/net/minecraft/client/render/block/model/generic/BlockModelCrystalBud.java b/game/client/src/main/java/net/minecraft/client/render/block/model/generic/BlockModelCrystalBud.java deleted file mode 100644 index a636a5e0f..000000000 --- a/game/client/src/main/java/net/minecraft/client/render/block/model/generic/BlockModelCrystalBud.java +++ /dev/null @@ -1,50 +0,0 @@ -package net.minecraft.client.render.block.model.generic; - -import net.minecraft.client.render.tessellator.TessellatorGeneral; -import net.minecraft.client.render.texture.stitcher.IconCoordinate; -import net.minecraft.core.block.Block; -import net.minecraft.core.block.BlockLogic; -import net.minecraft.core.block.BlockLogicRotatable; -import net.minecraft.core.util.helper.Direction; -import net.minecraft.core.world.WorldSource; -import net.minecraft.core.world.pos.TilePosc; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.useless.dragonfly.data.block.BlockModelData; -import org.useless.dragonfly.models.block.StaticBlockModel; - -public class BlockModelCrystalBud extends BlockModelGeneric { - public BlockModelCrystalBud(@NotNull Block block, @NotNull StaticBlockModel staticModel) { - super(block, staticModel); - } - - public BlockModelCrystalBud(@NotNull Block block, @NotNull BlockModelData staticModel) { - super(block, staticModel); - } - - @Override - public boolean renderAttached(@NotNull TessellatorGeneral tessellator, @NotNull WorldSource worldSource, @NotNull TilePosc tilePos, boolean cullFaces, @Nullable IconCoordinate overrideTexture) { - Direction direction = BlockLogicRotatable.getDirectionFromMeta(worldSource.getBlockData(tilePos)); - switch (direction) { - case UP -> { - return getModel(worldSource, tilePos).renderAttached(this, tessellator, worldSource, tilePos, 0, 0, 0, 0, 0, 0, false, cullFaces, overrideTexture); - } - case DOWN -> { - return getModel(worldSource, tilePos).renderAttached(this, tessellator, worldSource, tilePos, 2, 0, 0, 0, 0, 0, false, cullFaces, overrideTexture); - } - case NORTH -> { - return getModel(worldSource, tilePos).renderAttached(this, tessellator, worldSource, tilePos, -1, 0, 0, 0, 0, 0, false, cullFaces, overrideTexture); - } - case WEST -> { - return getModel(worldSource, tilePos).renderAttached(this, tessellator, worldSource, tilePos, 0, 0, 1, 0, 0, 0, false, cullFaces, overrideTexture); - } - case EAST -> { - return getModel(worldSource, tilePos).renderAttached(this, tessellator, worldSource, tilePos, 0, 0, -1, 0, 0, 0, false, cullFaces, overrideTexture); - } - case SOUTH -> { - return getModel(worldSource, tilePos).renderAttached(this, tessellator, worldSource, tilePos, 1, 0, 0, 0, 0, 0, false, cullFaces, overrideTexture); - } - } - return getModel(worldSource, tilePos).renderAttached(this, tessellator, worldSource, tilePos, 0, 0, 0, 0, 0, 0, false, cullFaces, overrideTexture); - } -} diff --git a/game/client/src/main/java/net/minecraft/client/render/block/model/generic/BlockModelGeneric.java b/game/client/src/main/java/net/minecraft/client/render/block/model/generic/BlockModelGeneric.java index 23c959528..6552fb74e 100644 --- a/game/client/src/main/java/net/minecraft/client/render/block/model/generic/BlockModelGeneric.java +++ b/game/client/src/main/java/net/minecraft/client/render/block/model/generic/BlockModelGeneric.java @@ -94,14 +94,6 @@ public class BlockModelGeneric extends BlockModel { private final @NotNull TilePos queryPos = new TilePos(); public boolean cullSide(@NotNull WorldSource worldSource, @NotNull TilePosc blockPos, @Nullable Direction direction) { if (direction != null) { - // Cull world ceiling and floors - WorldType worldType = worldSource.getWorldType(); - if (worldType.hasCeiling() && direction == Direction.UP && blockPos.y() >= worldType.getMaxY(worldSource)) { - return true; - } else if (direction == Direction.DOWN && blockPos.y() <= worldType.getMinY(worldSource)) { - return true; - } - TilePos shifted = blockPos.add(direction, this.queryPos); if (this.forceCullSelf) { return worldSource.getBlockType(shifted) == this.block || worldSource.isBlockOpaqueCube(shifted); diff --git a/game/client/src/main/java/net/minecraft/client/render/block/model/generic/BlockModelGenericCullBounderies.java b/game/client/src/main/java/net/minecraft/client/render/block/model/generic/BlockModelGenericCullBounderies.java new file mode 100644 index 000000000..28c29964d --- /dev/null +++ b/game/client/src/main/java/net/minecraft/client/render/block/model/generic/BlockModelGenericCullBounderies.java @@ -0,0 +1,36 @@ +package net.minecraft.client.render.block.model.generic; + +import net.minecraft.core.block.Block; +import net.minecraft.core.block.BlockLogic; +import net.minecraft.core.util.helper.Direction; +import net.minecraft.core.world.WorldSource; +import net.minecraft.core.world.pos.TilePosc; +import net.minecraft.core.world.type.WorldType; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.useless.dragonfly.data.block.BlockModelData; +import org.useless.dragonfly.models.block.StaticBlockModel; + +public class BlockModelGenericCullBounderies extends BlockModelGeneric { + public BlockModelGenericCullBounderies(@NotNull Block block, @NotNull StaticBlockModel staticModel) { + super(block, staticModel); + } + + public BlockModelGenericCullBounderies(@NotNull Block block, @NotNull BlockModelData staticModel) { + super(block, staticModel); + } + + @Override + public boolean cullSide(@NotNull WorldSource worldSource, @NotNull TilePosc blockPos, @Nullable Direction direction) { + if (direction != null) { + // Cull world ceiling and floors + WorldType worldType = worldSource.getWorldType(); + if (worldType.hasCeiling() && direction == Direction.UP && blockPos.y() >= worldType.getMaxY(worldSource)) { + return true; + } else if (worldType.hasFloor() && direction == Direction.DOWN && blockPos.y() <= worldType.getMinY(worldSource)) { + return true; + } + } + return super.cullSide(worldSource, blockPos, direction); + } +} diff --git a/game/client/src/main/java/net/minecraft/client/render/block/model/generic/BlockModelGenericSlab.java b/game/client/src/main/java/net/minecraft/client/render/block/model/generic/BlockModelGenericSlab.java index 5d1bcca76..8f7268aa8 100644 --- a/game/client/src/main/java/net/minecraft/client/render/block/model/generic/BlockModelGenericSlab.java +++ b/game/client/src/main/java/net/minecraft/client/render/block/model/generic/BlockModelGenericSlab.java @@ -2,6 +2,7 @@ package net.minecraft.client.render.block.model.generic; import net.minecraft.core.block.Block; import net.minecraft.core.block.BlockLogic; +import net.minecraft.core.block.BlockLogicSlab; import net.minecraft.core.util.helper.Direction; import net.minecraft.core.world.WorldSource; import net.minecraft.core.world.pos.TilePos; @@ -23,9 +24,10 @@ public class BlockModelGenericSlab extends BlockModelGener @Override public @NotNull StaticBlockModel getModelFromData(int data) { - return switch (data & 0b11) { - case 1 -> this.full; - case 2 -> this.upper; + return switch (data & BlockLogicSlab.MASK_STATE) { + case BlockLogicSlab.STATE_LOWER -> this.staticModel; + case BlockLogicSlab.STATE_DOUBLE -> this.full; + case BlockLogicSlab.STATE_UPPER -> this.upper; default -> this.staticModel; }; } @@ -33,28 +35,25 @@ public class BlockModelGenericSlab extends BlockModelGener private final @NotNull TilePos queryPos = new TilePos(); @Override public boolean cullSide(@NotNull WorldSource worldSource, @NotNull TilePosc blockPos, @Nullable Direction direction) { - int data = worldSource.getBlockData(blockPos); - boolean upperFaceVisible = (data & 0b11) == 1 || (data & 0b11) == 2; - boolean lowerFaceVisible = (data & 0b11) == 0 || (data & 0b11) == 1; - if (direction != null) { - // Cull world ceiling and floors - WorldType worldType = worldSource.getWorldType(); - if (worldType.hasCeiling() && direction == Direction.UP && blockPos.y() >= worldType.getMaxY(worldSource) && upperFaceVisible) { - return true; - } else if (direction == Direction.DOWN && blockPos.y() <= worldType.getMinY(worldSource) && lowerFaceVisible) { - return true; - } + TilePos otherPos = blockPos.add(direction, this.queryPos); + Block otherBlock = worldSource.getBlockType(otherPos); + if (otherBlock == this.block) { + int thisData = worldSource.getBlockData(blockPos); + boolean upperFaceCullable = (thisData & BlockLogicSlab.MASK_STATE) == BlockLogicSlab.STATE_DOUBLE || (thisData & BlockLogicSlab.MASK_STATE) == BlockLogicSlab.STATE_UPPER; + boolean lowerFaceCullable = (thisData & BlockLogicSlab.MASK_STATE) == BlockLogicSlab.STATE_LOWER || (thisData & BlockLogicSlab.MASK_STATE) == BlockLogicSlab.STATE_DOUBLE; + + int otherData = worldSource.getBlockData(otherPos); + boolean upperFaceVisible = (otherData & BlockLogicSlab.MASK_STATE) == BlockLogicSlab.STATE_DOUBLE || (otherData & BlockLogicSlab.MASK_STATE) == BlockLogicSlab.STATE_UPPER; + boolean lowerFaceVisible = (otherData & BlockLogicSlab.MASK_STATE) == BlockLogicSlab.STATE_LOWER || (otherData & BlockLogicSlab.MASK_STATE) == BlockLogicSlab.STATE_DOUBLE; - TilePos shifted = blockPos.add(direction, this.queryPos); - Block b = worldSource.getBlockType(shifted); - if (b == this.block) { - int otherData = worldSource.getBlockData(shifted); - if (otherData == 1) return true; - int selfData = worldSource.getBlockData(blockPos); - return selfData == otherData; + return switch (direction) { + case UP -> upperFaceCullable && lowerFaceVisible; + case DOWN -> lowerFaceCullable && upperFaceVisible; + default -> (otherData & BlockLogicSlab.MASK_STATE) == BlockLogicSlab.STATE_DOUBLE || thisData == otherData; // Cull sides on double slab or if the slab is on the same side (upper or lower) + }; } else { - return worldSource.isBlockOpaqueCube(shifted); + return worldSource.isBlockOpaqueCube(otherPos); } } return false; diff --git a/game/client/src/main/java/net/minecraft/client/render/entity/MobRenderer.java b/game/client/src/main/java/net/minecraft/client/render/entity/MobRenderer.java index 039dea3ca..957ee5aad 100644 --- a/game/client/src/main/java/net/minecraft/client/render/entity/MobRenderer.java +++ b/game/client/src/main/java/net/minecraft/client/render/entity/MobRenderer.java @@ -26,7 +26,7 @@ import java.util.ArrayList; import java.util.List; public abstract class MobRenderer extends EntityRenderer { - public static final float ENTITY_RENDER_SCALE = 16f; + public static final float ENTITY_RENDER_SCALE = 15.99f; private static final Logger LOGGER = LogUtils.getLogger(); private final @NotNull List<@Nullable StaticEntityModel> setupModels = new ArrayList<>(); diff --git a/game/client/src/main/java/net/minecraft/client/render/entity/MobRendererBipedArmored.java b/game/client/src/main/java/net/minecraft/client/render/entity/MobRendererBipedArmored.java index c177b3078..7443850f1 100644 --- a/game/client/src/main/java/net/minecraft/client/render/entity/MobRendererBipedArmored.java +++ b/game/client/src/main/java/net/minecraft/client/render/entity/MobRendererBipedArmored.java @@ -2,6 +2,7 @@ package net.minecraft.client.render.entity; import net.minecraft.client.render.item.model.ItemModelDispatcher; import net.minecraft.client.render.renderer.GLRenderer; +import net.minecraft.client.render.renderer.Shaders; import net.minecraft.client.render.renderer.State; import net.minecraft.client.render.tessellator.TessellatorGeneral; import net.minecraft.core.entity.IArmorWearing; @@ -104,6 +105,7 @@ public abstract class MobRendererBipedArmored block = getMossBlock(world.getBlockType(randomPos)); - if (block != null) { - world.setBlockTypeNotify(randomPos, block); - } - } + final var dirs = new Direction[Direction.count]; + System.arraycopy(Direction.all, 0, dirs, 0, Direction.count); + + for (int i = 0; i < Direction.count; i++) { + final int j = world.rand.nextInt(Direction.count - i) + i; + final var testPos = tilePos.add(dirs[j], query); + dirs[j] = dirs[i]; + + if (!this.canMossSpread(world, testPos)) continue; + @Nullable Block mossStone = getMossBlock(world.getBlockType(testPos)); + if (mossStone == null) continue; + + if (!world.setBlockTypeNotify(testPos, mossStone)) continue; + itemStack.consumeItem(player); + return true; } - return true; + return false; } public boolean airExposed(@NotNull World world, @NotNull TilePosc tilePos) { diff --git a/game/core/src/main/java/net/minecraft/core/block/BlockLogicSponge.java b/game/core/src/main/java/net/minecraft/core/block/BlockLogicSponge.java index 2a1c03195..86705f3c0 100644 --- a/game/core/src/main/java/net/minecraft/core/block/BlockLogicSponge.java +++ b/game/core/src/main/java/net/minecraft/core/block/BlockLogicSponge.java @@ -15,6 +15,7 @@ import java.util.Random; public class BlockLogicSponge extends BlockLogic { final boolean isWet; + boolean skipDrying = false; public BlockLogicSponge(@NotNull Block block, boolean isWet) { super(block, Materials.SPONGE); @@ -24,8 +25,11 @@ public class BlockLogicSponge extends BlockLogic { @Override public void onPlacedByWorld(@NotNull World world, @NotNull TilePosc tilePos) { super.onPlacedByWorld(world, tilePos); + if (this.skipDrying) return; if ((world.getWorldType().hasTag(WorldTypeTags.HOT) || inHot(world, tilePos)) && this.isWet) { + this.skipDrying = true; world.setBlockTypeNotify(tilePos, Blocks.SPONGE_DRY); + this.skipDrying = false; world.playSoundEffect(null, SoundCategory.WORLD_SOUNDS, tilePos.x() + 0.5D, tilePos.y() + 0.5D, tilePos.z() + 0.5D, "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F); for (int l = 0; l < 8; l++) { world.spawnParticle("largesmoke", (double) tilePos.x() + Math.random(), (double) tilePos.y() + Math.random(), (double) tilePos.z() + Math.random(), 0.0D, 0.0D, 0.0D, 0, false); diff --git a/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityActivator.java b/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityActivator.java index 374e034f4..bc066db77 100644 --- a/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityActivator.java +++ b/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityActivator.java @@ -232,7 +232,7 @@ public class TileEntityActivator extends TileEntity implements Container, ICarry } @Override - public @NotNull ICarriable pickup(@NotNull World world, @NotNull Entity holder, @NotNull TilePosc tilePos_) { + public @Nullable ICarriable pickup(@NotNull World world, @NotNull Entity holder, @NotNull TilePosc tilePos_) { return super.pickup(world, holder, tilePos_); } diff --git a/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityBasket.java b/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityBasket.java index 424111057..cd3774ccb 100644 --- a/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityBasket.java +++ b/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityBasket.java @@ -22,6 +22,7 @@ import net.minecraft.core.world.World; import net.minecraft.core.world.pos.TilePosc; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import org.joml.primitives.AABBd; import org.joml.primitives.AABBdc; @@ -236,7 +237,7 @@ public class TileEntityBasket extends TileEntity implements ICarrySource { } @Override - public @NotNull ICarriable pickup(@NotNull World world, @NotNull Entity holder, @NotNull TilePosc tilePos_) { + public @Nullable ICarriable pickup(@NotNull World world, @NotNull Entity holder, @NotNull TilePosc tilePos_) { return super.pickup(world, holder, tilePos_); } diff --git a/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityChest.java b/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityChest.java index 4b05280a8..876ec1cca 100644 --- a/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityChest.java +++ b/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityChest.java @@ -156,7 +156,7 @@ public class TileEntityChest extends TileEntity } @Override - public @NotNull ICarriable pickup(@NotNull World world, @NotNull Entity holder, @NotNull TilePosc tilePos_) { + public @Nullable ICarriable pickup(@NotNull World world, @NotNull Entity holder, @NotNull TilePosc tilePos_) { return super.pickup(world, holder, tilePos_); } diff --git a/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityDispenser.java b/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityDispenser.java index 91bdcd264..4cfc1c4f7 100644 --- a/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityDispenser.java +++ b/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityDispenser.java @@ -219,7 +219,7 @@ public class TileEntityDispenser extends TileEntity } @Override - public @NotNull ICarriable pickup(@NotNull World world, @NotNull Entity holder, @NotNull TilePosc tilePos_) { + public @Nullable ICarriable pickup(@NotNull World world, @NotNull Entity holder, @NotNull TilePosc tilePos_) { return super.pickup(world, holder, tilePos_); } diff --git a/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityFurnace.java b/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityFurnace.java index d000affae..23006d561 100644 --- a/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityFurnace.java +++ b/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityFurnace.java @@ -396,7 +396,7 @@ public class TileEntityFurnace extends TileEntity } @Override - public @NotNull ICarriable pickup(@NotNull World world, @NotNull Entity holder, @NotNull TilePosc tilePos_) { + public @Nullable ICarriable pickup(@NotNull World world, @NotNull Entity holder, @NotNull TilePosc tilePos_) { return super.pickup(world, holder, tilePos_); } diff --git a/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityFurnaceBlast.java b/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityFurnaceBlast.java index 87b75ad4a..e2bb6252c 100644 --- a/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityFurnaceBlast.java +++ b/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityFurnaceBlast.java @@ -354,7 +354,7 @@ public class TileEntityFurnaceBlast extends TileEntity } @Override - public @NotNull ICarriable pickup(@NotNull World world, @NotNull Entity holder, @NotNull TilePosc tilePos_) { + public @Nullable ICarriable pickup(@NotNull World world, @NotNull Entity holder, @NotNull TilePosc tilePos_) { return super.pickup(world, holder, tilePos_); } diff --git a/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityTrommel.java b/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityTrommel.java index 691d2cbe5..d29136e9a 100644 --- a/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityTrommel.java +++ b/game/core/src/main/java/net/minecraft/core/block/entity/TileEntityTrommel.java @@ -574,7 +574,7 @@ public class TileEntityTrommel extends TileEntity } @Override - public @NotNull ICarriable pickup(@NotNull World world, @NotNull Entity holder, @NotNull TilePosc tilePos_) { + public @Nullable ICarriable pickup(@NotNull World world, @NotNull Entity holder, @NotNull TilePosc tilePos_) { return super.pickup(world, holder, tilePos_); } diff --git a/game/core/src/main/java/net/minecraft/core/entity/EntityFallingBlock.java b/game/core/src/main/java/net/minecraft/core/entity/EntityFallingBlock.java index e4f2f14cd..761f2b269 100644 --- a/game/core/src/main/java/net/minecraft/core/entity/EntityFallingBlock.java +++ b/game/core/src/main/java/net/minecraft/core/entity/EntityFallingBlock.java @@ -262,6 +262,7 @@ public class EntityFallingBlock extends Entity this.carriedBlock.entity.writeToNBT(entityTag); tag.putCompound("TileEntity", entityTag); } + tag.putBoolean("hasRemovedBlock", this.hasRemovedBlock); } @Override @@ -274,6 +275,7 @@ public class EntityFallingBlock extends Entity if (this.carriedBlock.entity != null) { this.carriedBlock.entity.carriedBlock = this.carriedBlock; } + this.hasRemovedBlock = tag.getBooleanOrDefault("hasRemovedBlock", true); } @Override diff --git a/game/core/src/main/java/net/minecraft/core/entity/player/Player.java b/game/core/src/main/java/net/minecraft/core/entity/player/Player.java index 3e6016425..e0a0e7dc9 100644 --- a/game/core/src/main/java/net/minecraft/core/entity/player/Player.java +++ b/game/core/src/main/java/net/minecraft/core/entity/player/Player.java @@ -1816,6 +1816,8 @@ public abstract class Player nextArrow = Items.AMMO_ARROW; } else if (quiverSlot != null && quiverSlot.itemID == Items.ARMOR_QUIVER_GOLD.id) { nextArrow = Items.AMMO_ARROW_PURPLE; + } else if (hasItem(Items.AMMO_ARROW_FLAMING)) { + nextArrow = Items.AMMO_ARROW_FLAMING; } else if (hasItem(Items.AMMO_ARROW_GOLD)) { nextArrow = Items.AMMO_ARROW_GOLD; } else if (hasItem(Items.AMMO_ARROW)) { diff --git a/game/core/src/main/java/net/minecraft/core/item/ItemBow.java b/game/core/src/main/java/net/minecraft/core/item/ItemBow.java index 4f28e67cc..0f51b4e85 100644 --- a/game/core/src/main/java/net/minecraft/core/item/ItemBow.java +++ b/game/core/src/main/java/net/minecraft/core/item/ItemBow.java @@ -2,6 +2,7 @@ package net.minecraft.core.item; import net.minecraft.core.entity.projectile.ProjectileArrow; +import net.minecraft.core.entity.projectile.ProjectileArrowFlaming; import net.minecraft.core.entity.projectile.ProjectileArrowGolden; import net.minecraft.core.entity.projectile.ProjectileArrowPurple; import net.minecraft.core.entity.player.Player; @@ -34,6 +35,13 @@ public class ItemBow extends Item { if (!world.isClientSide) { world.entityJoinedWorld(new ProjectileArrowPurple(world, player, false)); } + } else if (player.inventory.consumeInventoryItem(Items.AMMO_ARROW_FLAMING.id)) { + selfStack.damageItem(1, player); + world.playSoundAtEntity(player, player, "random.bow", 0.3f, 1.0F / (itemRand.nextFloat() * 0.4F + 0.8F)); + if(!world.isClientSide) + { + world.entityJoinedWorld(new ProjectileArrowFlaming(world, player, true)); + } } else if (player.inventory.consumeInventoryItem(Items.AMMO_ARROW_GOLD.id)) { selfStack.damageItem(1, player); diff --git a/game/core/src/main/java/net/minecraft/core/item/ItemJar.java b/game/core/src/main/java/net/minecraft/core/item/ItemJar.java index 86da7cdc2..2629cb1b5 100644 --- a/game/core/src/main/java/net/minecraft/core/item/ItemJar.java +++ b/game/core/src/main/java/net/minecraft/core/item/ItemJar.java @@ -85,6 +85,8 @@ public class ItemJar extends ItemPlaceable { final int count = pokemon.onCaptured(); if (count == 0) return null; + if (!selfStack.consumeItem(player)) return null; + final Item resultingItem; if (pokemon instanceof MobFireflyCluster firefly) resultingItem = captureFirefly(firefly); else if (pokemon instanceof MobButterfly butterfly) resultingItem = captureButterfly(butterfly); diff --git a/game/core/src/main/java/net/minecraft/core/player/inventory/slot/SlotResult.java b/game/core/src/main/java/net/minecraft/core/player/inventory/slot/SlotResult.java index 2b7fabb42..3e57f99a4 100644 --- a/game/core/src/main/java/net/minecraft/core/player/inventory/slot/SlotResult.java +++ b/game/core/src/main/java/net/minecraft/core/player/inventory/slot/SlotResult.java @@ -37,6 +37,7 @@ public class SlotResult extends Slot if(item.id == Blocks.WORKBENCH.id()) thePlayer.addStat(Achievements.BUILD_WORKBENCH, 1); if(item.id == Blocks.FURNACE_STONE_IDLE.id()) thePlayer.addStat(Achievements.BUILD_FURNACE, 1); + if(item.id == Blocks.FURNACE_BLAST_IDLE.id()) thePlayer.addStat(Achievements.GET_STEEL_BLAST_FURNACE, 1); if(item.id == Items.FOOD_BREAD.id) thePlayer.addStat(Achievements.MAKE_BREAD, 1); if(item.id == Items.FOOD_CAKE.id) thePlayer.addStat(Achievements.BAKE_CAKE, 1); if(item instanceof ItemBucket && ItemBucket.getState(itemStack) == ItemBucket.STATE_ICECREAM) thePlayer.addStat(Achievements.CRAFT_ICECREAM, 1); diff --git a/game/core/src/main/java/net/minecraft/core/world/ICarrySource.java b/game/core/src/main/java/net/minecraft/core/world/ICarrySource.java index 4a12e9ec3..34e14520f 100644 --- a/game/core/src/main/java/net/minecraft/core/world/ICarrySource.java +++ b/game/core/src/main/java/net/minecraft/core/world/ICarrySource.java @@ -7,7 +7,7 @@ import net.minecraft.core.entity.Entity; import net.minecraft.core.world.pos.TilePosc; public interface ICarrySource { - @NotNull ICarriable pickup(@NotNull World world, @NotNull Entity holder, @NotNull TilePosc tilePos); + @Nullable ICarriable pickup(@NotNull World world, @NotNull Entity holder, @NotNull TilePosc tilePos); public static @Nullable ICarrySource getFromWorld(@NotNull World world, @NotNull TilePosc tilePos) { if (world.getTileEntity(tilePos) instanceof ICarrySource carryTE) return carryTE; @@ -15,11 +15,12 @@ public interface ICarrySource { return null; } - public static @Nullable ICarrySource tryPickUpFromWorld(@NotNull World world, @NotNull Entity holder, @NotNull TilePosc tilePos) { + public static @Nullable ICarriable tryPickUpFromWorld(@NotNull World world, @NotNull Entity holder, @NotNull TilePosc tilePos) { final @Nullable var carry = getFromWorld(world, tilePos); - if (carry != null) { - holder.setHeldObject(carry.pickup(world, holder, tilePos)); - } - return carry; + if (carry == null) return null; + final var carried = carry.pickup(world, holder, tilePos); + if (carried == null) return null; + holder.setHeldObject(carried); + return carried; } } diff --git a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/debug/ChunkDecoratorDebug.java b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/debug/ChunkDecoratorDebug.java index 7fe89a8da..9a03bee83 100644 --- a/game/core/src/main/java/net/minecraft/core/world/generate/chunk/debug/ChunkDecoratorDebug.java +++ b/game/core/src/main/java/net/minecraft/core/world/generate/chunk/debug/ChunkDecoratorDebug.java @@ -24,7 +24,7 @@ public class ChunkDecoratorDebug int blockId = chunkBlockOffset + blockBlockOffset; int meta = chunkMetaOffset + blockMetaOffset; - if (blockId < 0 || blockId >= Blocks.blocksList.length || Blocks.blocksList[blockId] == null) + if (blockId < 0 || blockId >= Blocks.blocksList.length || Blocks.blocksList[blockId] == null || blockId == Blocks.WIRE_REDSTONE.id()) // Redstone seems to crash debug worlds, they don't stay placed anyway so this is the most convient fix -Useless continue; chunk.setBlockIDWithMetadata(x, 0, z, blockId, meta); diff --git a/game/core/src/main/java/net/minecraft/core/world/type/WorldType.java b/game/core/src/main/java/net/minecraft/core/world/type/WorldType.java index b28652865..f21c4a808 100644 --- a/game/core/src/main/java/net/minecraft/core/world/type/WorldType.java +++ b/game/core/src/main/java/net/minecraft/core/world/type/WorldType.java @@ -34,6 +34,7 @@ public abstract class WorldType private final Weather defaultWeather; private final WindProvider windProvider; private final boolean hasCeiling; + private final boolean hasFloor; private final float[] brightnessRamp; private final SeasonConfig seasonConfig; private final int minY; @@ -51,6 +52,7 @@ public abstract class WorldType this.defaultWeather = properties.defaultWeather == null ? Weathers.OVERWORLD_CLEAR : properties.defaultWeather; this.windProvider = properties.windProvider == null ? new WindProviderGeneric() : properties.windProvider; this.hasCeiling = properties.hasCeiling; + this.hasFloor = properties.hasFloor; this.brightnessRamp = properties.brightnessRamp; this.seasonConfig = properties.seasonConfig == null ? SeasonConfig.builder().withSingleSeason(Seasons.NULL).build() : properties.seasonConfig; this.minY = properties.minY; @@ -99,6 +101,10 @@ public abstract class WorldType return hasCeiling; } + public boolean hasFloor() { + return hasFloor; + } + public float[] getBrightnessRamp() { return brightnessRamp; } @@ -314,6 +320,7 @@ public abstract class WorldType private Weather defaultWeather = null; private WindProvider windProvider = null; private boolean hasCeiling = false; + private boolean hasFloor = true; private float[] brightnessRamp = null; private SeasonConfig seasonConfig = null; private int minY = 0; @@ -350,6 +357,11 @@ public abstract class WorldType return this; } + public @NotNull Properties withNoFloor() { + this.hasFloor = false; + return this; + } + public @NotNull Properties brightnessRamp(float[] brightnessRamp) { this.brightnessRamp = brightnessRamp; return this; diff --git a/game/core/src/main/java/net/minecraft/core/world/type/WorldTypes.java b/game/core/src/main/java/net/minecraft/core/world/type/WorldTypes.java index 539333335..930400073 100644 --- a/game/core/src/main/java/net/minecraft/core/world/type/WorldTypes.java +++ b/game/core/src/main/java/net/minecraft/core/world/type/WorldTypes.java @@ -42,6 +42,7 @@ public abstract class WorldTypes { new WorldTypeNetherSkyblock( WorldTypeNether.defaultProperties("worldType.nether.skyblock") .bounds(0, 127, 0) + .withNoFloor() .withTags(WorldTypeTags.NETHER, WorldTypeTags.HOT, WorldTypeTags.BREAKS_COMPASS, WorldTypeTags.BREAKS_TIMEPIECES) ) ); @@ -49,6 +50,7 @@ public abstract class WorldTypes { "minecraft:drift.default", new WorldTypeDrift( WorldTypeDrift.defaultProperties("worldType.drift.default") + .withNoFloor() .withTags(WorldTypeTags.DRIFT, WorldTypeTags.COLD, WorldTypeTags.BREAKS_COMPASS, WorldTypeTags.BREAKS_TIMEPIECES) ) ); @@ -74,6 +76,7 @@ public abstract class WorldTypes { WorldTypeOverworld.defaultProperties("worldType.overworld.floating") .bounds(0, 255, 0) .oceanBlocks() + .withNoFloor() .withTags(WorldTypeTags.OVERWORLD) ) ); @@ -190,6 +193,7 @@ public abstract class WorldTypes { WorldTypeOverworld.defaultProperties("worldType.overworld.skyblock") .bounds(0, 127, 0) .portalBounds(0, 255) + .withNoFloor() .withTags(WorldTypeTags.OVERWORLD) ) ); @@ -207,6 +211,7 @@ public abstract class WorldTypes { WorldType.Properties.of("worldType.empty") .brightnessRamp(WorldTypeEmpty.createLightRamp()) .bounds(0, 255, 0) + .withNoFloor() .allowRespawn() ) ); @@ -216,6 +221,7 @@ public abstract class WorldTypes { WorldType.Properties.of("worldType.debug") .brightnessRamp(WorldTypeDebug.createLightRamp()) .bounds(0, 255, 0) + .withNoFloor() .allowRespawn() ) ); diff --git a/game/core/src/main/java/net/minecraft/core/world/weather/WeatherStorm.java b/game/core/src/main/java/net/minecraft/core/world/weather/WeatherStorm.java index c081905ca..beca41ac7 100644 --- a/game/core/src/main/java/net/minecraft/core/world/weather/WeatherStorm.java +++ b/game/core/src/main/java/net/minecraft/core/world/weather/WeatherStorm.java @@ -53,14 +53,14 @@ public class WeatherStorm extends WeatherRain { } } } - - if (world.canBlockBeRainedOn(targetX, targetY, targetZ)) { + if (maxWeight > Integer.MIN_VALUE) { world.addWeatherEffect(new EntityLightning(world, targetX, targetY, targetZ)); } } } private static int evalStrikeWeight(final @NotNull World world, final @NotNull Random random, final int orgX, final int orgZ, final int checkX, final int checkY, final int checkZ) { + if (!world.canBlockBeRainedOn(checkX, checkY, checkZ)) return Integer.MIN_VALUE; final @NotNull Material material = world.getBlockMaterial(checkX, checkY - 1, checkZ); int weight = random.nextInt(10); weight += checkY; @@ -73,8 +73,8 @@ public class WeatherStorm extends WeatherRain { final int distX = (checkX - orgX); final int distZ = (checkZ - orgZ); - final double dist = Math.sqrt(distX * distX + distZ + distZ); - final int decayFactor = MathHelper.floor(Math.sqrt(dist) / 4); + final double dist = Math.sqrt(distX * distX + distZ * distZ); + final int decayFactor = MathHelper.floor(dist / 4); weight -= decayFactor; return weight; diff --git a/game/core/src/main/resources/assets/minecraft/lang/en_US/stats.lang b/game/core/src/main/resources/assets/minecraft/lang/en_US/stats.lang index ca1dd8f0a..0a3bad62e 100644 --- a/game/core/src/main/resources/assets/minecraft/lang/en_US/stats.lang +++ b/game/core/src/main/resources/assets/minecraft/lang/en_US/stats.lang @@ -57,9 +57,9 @@ achievement.downTheDrain.desc=Use a mesh block underwater to siphon items. achievement.buildHoe=Time to Farm! achievement.buildHoe.desc=Use planks and sticks to make a hoe. achievement.makeBread=Bake Bread -achievement.makeBread.desc=Turn wheat into bread. +achievement.makeBread.desc=Bake dough into bread. achievement.bakeCake=The Lie -achievement.bakeCake.desc=Wheat, sugar, milk and eggs! +achievement.bakeCake.desc=Dough, sugar, milk and eggs! achievement.buildBetterPickaxe=Getting an Upgrade achievement.buildBetterPickaxe.desc=Construct a better pickaxe. achievement.cookFish=Delicious Fish @@ -105,8 +105,8 @@ achievement.tripleHit.desc=Hit three mobs with a single golden arrow. achievement.enterNether=Hell Bent achievement.enterNether.desc=Enter the Nether. -achievement.swimNether=Frozen Over -achievement.swimNether.desc=Melt some ice and take a swim. +achievement.swimNether=Hot Spring +achievement.swimNether.desc=Take a "relaxing" swim in the Nether. achievement.enterWarrens=Hidden Depths achievement.enterWarrens.desc=Enter the Warrens. achievement.getNethercoal=Hot Stuff diff --git a/util/datagen/src/main/java/net/minecraft/datagen/WorkbenchGenerator.java b/util/datagen/src/main/java/net/minecraft/datagen/WorkbenchGenerator.java index 0b36bb940..ca95a3382 100644 --- a/util/datagen/src/main/java/net/minecraft/datagen/WorkbenchGenerator.java +++ b/util/datagen/src/main/java/net/minecraft/datagen/WorkbenchGenerator.java @@ -390,6 +390,10 @@ class WorkbenchGenerator { .addInput(Blocks.SLATE) .create("slate_to_slate_layers", new ItemStack(Blocks.LAYER_SLATE, 8)); + RecipeBuilder.Shapeless(CORE_NAMESPACE) + .addInput(Blocks.BLOCK_ASH) + .create("ash_to_ash_layers", new ItemStack(Blocks.LAYER_ASH, 8)); + RecipeBuilder.Shapeless(CORE_NAMESPACE) .addInput(Blocks.LEAVES_OAK) .create("oak_leaves_to_leaf_pile", new ItemStack(Blocks.LAYER_LEAVES_OAK, 8)); @@ -1259,8 +1263,24 @@ class WorkbenchGenerator { RecipeBuilderShaped plate = RecipeBuilder.Shaped(CORE_NAMESPACE).setShape("##"); plate.addInput('#', Blocks.STONE).create("stone_pressure_plate", Blocks.PRESSURE_PLATE_STONE.getDefaultStack()); + plate.addInput('#', Blocks.BASALT).create("basalt_pressure_plate", Blocks.PRESSURE_PLATE_BASALT.getDefaultStack()); + plate.addInput('#', Blocks.LIMESTONE).create("limestone_pressure_plate", Blocks.PRESSURE_PLATE_LIMESTONE.getDefaultStack()); + plate.addInput('#', Blocks.GRANITE).create("granite_pressure_plate", Blocks.PRESSURE_PLATE_GRANITE.getDefaultStack()); + plate.addInput('#', Blocks.PERMAFROST).create("permafrost_pressure_plate", Blocks.PRESSURE_PLATE_PERMAFROST.getDefaultStack()); + plate.addInput('#', Blocks.NETHERRACK).create("netherrack_pressure_plate", Blocks.PRESSURE_PLATE_NETHERRACK.getDefaultStack()); + plate.addInput('#', Blocks.GLOOMSTONE).create("gloomstone_pressure_plate", Blocks.PRESSURE_PLATE_GLOOMSTONE.getDefaultStack()); + plate.addInput('#', Blocks.SANDSTONE).create("sandstone_pressure_plate", Blocks.PRESSURE_PLATE_SANDSTONE.getDefaultStack()); + plate.addInput('#', Blocks.BRIMSTONE).create("brimstone_pressure_plate", Blocks.PRESSURE_PLATE_BRIMSTONE.getDefaultStack()); + + plate.addInput('#', Blocks.COBBLE_STONE).create("cobble_stone_pressure_plate", Blocks.PRESSURE_PLATE_COBBLE_STONE.getDefaultStack()); + plate.addInput('#', Blocks.COBBLE_BASALT).create("cobble_basalt_pressure_plate", Blocks.PRESSURE_PLATE_COBBLE_BASALT.getDefaultStack()); + plate.addInput('#', Blocks.COBBLE_LIMESTONE).create("cobble_limestone_pressure_plate", Blocks.PRESSURE_PLATE_COBBLE_LIMESTONE.getDefaultStack()); + plate.addInput('#', Blocks.COBBLE_GRANITE).create("cobble_granite_pressure_plate", Blocks.PRESSURE_PLATE_COBBLE_GRANITE.getDefaultStack()); + plate.addInput('#', Blocks.COBBLE_PERMAFROST).create("cobble_permafrost_pressure_plate", Blocks.PRESSURE_PLATE_COBBLE_PERMAFROST.getDefaultStack()); + plate.addInput('#', Blocks.COBBLE_NETHERRACK).create("cobble_netherrack_pressure_plate", Blocks.PRESSURE_PLATE_COBBLE_NETHERRACK.getDefaultStack()); + plate.addInput('#', Blocks.COBBLE_GLOOMSTONE).create("cobble_gloomstone_pressure_plate", Blocks.PRESSURE_PLATE_COBBLE_GLOOMSTONE.getDefaultStack()); + plate.addInput('#', Blocks.PLANKS_OAK).create("wooden_pressure_plate", Blocks.PRESSURE_PLATE_PLANKS_OAK.getDefaultStack()); - plate.addInput('#', "minecraft:cobblestones").create("cobblestone_pressure_plate", Blocks.PRESSURE_PLATE_COBBLE_STONE.getDefaultStack()); for (DyeColor color : DyeColor.values()) { plate.addInput('#', Blocks.PLANKS_OAK_PAINTED, color.blockMeta).create(color.colorID + "_wooden_pressure_plate", new ItemStack(Blocks.PRESSURE_PLATE_PLANKS_OAK_PAINTED, 1, color.blockMeta << 4)); }