diff --git a/build.gradle b/build.gradle index bab9871f1..71f46fd5e 100644 --- a/build.gradle +++ b/build.gradle @@ -2,8 +2,8 @@ buildscript { repositories { mavenCentral() maven { - name = "forge" - url = "https://files.minecraftforge.net/maven" + name "forge" + url "https://files.minecraftforge.net/maven" } } dependencies { @@ -82,29 +82,33 @@ sourceSets.main.resources { repositories { mavenCentral() maven { - url = "https://maven.blamejared.com" + name "yarn2mcp" + url "https://maven.tterrag.com/" } maven { - url = "https://dvs1.progwml6.com/files/maven" + url "https://maven.blamejared.com" } maven { - url = "https://minecraft.curseforge.com/api/maven/" + url "https://dvs1.progwml6.com/files/maven" } maven { - name = "curios" - url = "https://maven.theillusivec4.top/" + url "https://minecraft.curseforge.com/api/maven/" + } + maven { + name "curios" + url "https://maven.theillusivec4.top/" } } dependencies { minecraft "net.minecraftforge:forge:${config.mc_version}-${config.forge_version}" - compile fg.deobf("vazkii.patchouli:Patchouli:1.1-22.43") { transitive = false } + // compile fg.deobf("vazkii.patchouli:Patchouli:1.1-22.43") { transitive = false } - compileOnly fg.deobf("mezz.jei:jei-1.14.4:6.0.0.11:api") - runtimeOnly fg.deobf("mezz.jei:jei-1.14.4:6.0.0.11") + compileOnly fg.deobf("mezz.jei:jei-1.15.1:6.0.0.1:api") + runtimeOnly fg.deobf("mezz.jei:jei-1.15.1:6.0.0.1") - compileOnly fg.deobf("top.theillusivec4.curios:curios:FORGE-1.14.4-1.0.2:api") - runtimeOnly fg.deobf("top.theillusivec4.curios:curios:FORGE-1.14.4-1.0.2") + compileOnly fg.deobf("top.theillusivec4.curios:curios:FORGE-1.15.1-2.0-beta:api") + runtimeOnly fg.deobf("top.theillusivec4.curios:curios:FORGE-1.15.1-2.0-beta") } if (System.getenv().BUILD_NUMBER != null) { diff --git a/build.properties b/build.properties index 776849729..32e08e156 100644 --- a/build.properties +++ b/build.properties @@ -1,10 +1,10 @@ # #Mon Jan 06 23:39:07 CST 2020 version=r1.11 -mc_mappings=20191111-1.14.3 +mc_mappings=20200108-mixed-1.15.1 dir_output=../Build Output/Botania/ -mc_version=1.14.4 +mc_version=1.15.1 dir_repo=./ -forge_version=28.1.92 +forge_version=30.0.35 build_number=376 mod_name=Botania diff --git a/src/main/java/vazkii/botania/api/boss/IBotaniaBoss.java b/src/main/java/vazkii/botania/api/boss/IBotaniaBoss.java index 010f689a2..7ac704ab3 100644 --- a/src/main/java/vazkii/botania/api/boss/IBotaniaBoss.java +++ b/src/main/java/vazkii/botania/api/boss/IBotaniaBoss.java @@ -11,7 +11,7 @@ package vazkii.botania.api.boss; import net.minecraft.util.ResourceLocation; -import net.minecraft.world.ServerBossInfo; +import net.minecraft.world.server.ServerBossInfo; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import vazkii.botania.api.internal.ShaderCallback; diff --git a/src/main/java/vazkii/botania/api/subtile/TileEntitySpecialFlower.java b/src/main/java/vazkii/botania/api/subtile/TileEntitySpecialFlower.java index c55e330b8..e19ffc7d8 100644 --- a/src/main/java/vazkii/botania/api/subtile/TileEntitySpecialFlower.java +++ b/src/main/java/vazkii/botania/api/subtile/TileEntitySpecialFlower.java @@ -24,6 +24,7 @@ import net.minecraft.network.play.server.SUpdateTileEntityPacket; import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; +import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.Hand; import net.minecraft.util.ResourceLocation; @@ -237,7 +238,7 @@ public class TileEntitySpecialFlower extends TileEntity implements ITickableTile /** * Called when a player right clicks this sub tile. */ - public boolean onBlockActivated(World world, BlockPos pos, BlockState state, PlayerEntity player, Hand hand, BlockRayTraceResult hit) { return false; } + public ActionResultType onBlockActivated(World world, BlockPos pos, BlockState state, PlayerEntity player, Hand hand, BlockRayTraceResult hit) { return ActionResultType.PASS; } /** * Called when this sub tile is added to the world. diff --git a/src/main/java/vazkii/botania/client/core/handler/BossBarHandler.java b/src/main/java/vazkii/botania/client/core/handler/BossBarHandler.java index 05431ea32..98d0e4296 100644 --- a/src/main/java/vazkii/botania/client/core/handler/BossBarHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/BossBarHandler.java @@ -53,7 +53,7 @@ public final class BossBarHandler { Rectangle bgRect = currentBoss.getBossBarTextureRect(); Rectangle fgRect = currentBoss.getBossBarHPTextureRect(); String name = evt.getBossInfo().getName().getFormattedText(); - int c = Minecraft.getInstance().mainWindow.getScaledWidth() / 2; + int c = Minecraft.getInstance().getWindow().getScaledWidth() / 2; int x = evt.getX(); int y = evt.getY(); int xf = x + (bgRect.width - fgRect.width) / 2; diff --git a/src/main/java/vazkii/botania/client/core/handler/HUDHandler.java b/src/main/java/vazkii/botania/client/core/handler/HUDHandler.java index c98e1b8c7..247acd3d1 100644 --- a/src/main/java/vazkii/botania/client/core/handler/HUDHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/HUDHandler.java @@ -257,8 +257,8 @@ public final class HUDHandler { int color = 0x00CC00 + (alpha << 24); String disp = I18n.format(ItemTwigWand.getModeString(stack)); - int x = mc.mainWindow.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(disp) / 2; - int y = mc.mainWindow.getScaledHeight() - 70; + int x = mc.getWindow().getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(disp) / 2; + int y = mc.getWindow().getScaledHeight() - 70; GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); @@ -271,8 +271,8 @@ public final class HUDHandler { private static void renderManaInvBar(boolean hasCreative, int totalMana, int totalMaxMana) { Minecraft mc = Minecraft.getInstance(); int width = 182; - int x = mc.mainWindow.getScaledWidth() / 2 - width / 2; - int y = mc.mainWindow.getScaledHeight() - ConfigHandler.CLIENT.manaBarHeight.get(); + int x = mc.getWindow().getScaledWidth() / 2 - width / 2; + int y = mc.getWindow().getScaledHeight() - ConfigHandler.CLIENT.manaBarHeight.get(); if(!hasCreative) { if(totalMaxMana == 0) @@ -304,8 +304,8 @@ public final class HUDHandler { profiler.startSection("poolRecipe"); RecipeManaInfusion recipe = TilePool.getMatchingRecipe(stack, tile.getWorld().getBlockState(tile.getPos().down())); if(recipe != null) { - int x = mc.mainWindow.getScaledWidth() / 2 - 11; - int y = mc.mainWindow.getScaledHeight() / 2 + 10; + int x = mc.getWindow().getScaledWidth() / 2 - 11; + int y = mc.getWindow().getScaledHeight() / 2 + 10; int u = tile.getCurrentMana() >= recipe.getManaToConsume() ? 0 : 22; int v = mc.player.getName().getString().equals("haighyorkie") && mc.player.isSneaking() ? 23 : 8; @@ -339,8 +339,8 @@ public final class HUDHandler { String s1 = target.getDisplayName().getString(); String s2 = tile.getItemCount() + "x"; int strlen = Math.max(mc.fontRenderer.getStringWidth(s1), mc.fontRenderer.getStringWidth(s2)); - int w = mc.mainWindow.getScaledWidth(); - int h = mc.mainWindow.getScaledHeight(); + int w = mc.getWindow().getScaledWidth(); + int h = mc.getWindow().getScaledHeight(); int boxH = h / 2 + (tile.locked ? 20 : 10); AbstractGui.fill(w / 2 + 8, h / 2 - 12, w / 2 + strlen + 32, boxH, 0x44000000); AbstractGui.fill(w / 2 + 6, h / 2 - 14, w / 2 + strlen + 34, boxH + 2, 0x44000000); @@ -365,8 +365,8 @@ public final class HUDHandler { String txt2 = TextFormatting.GRAY + I18n.format("botaniamisc.nearIndex2"); int l = Math.max(mc.fontRenderer.getStringWidth(txt0), Math.max(mc.fontRenderer.getStringWidth(txt1), mc.fontRenderer.getStringWidth(txt2))) + 20; - int x = mc.mainWindow.getScaledWidth() - l - 20; - int y = mc.mainWindow.getScaledHeight() - 60; + int x = mc.getWindow().getScaledWidth() - l - 20; + int y = mc.getWindow().getScaledHeight() - 60; AbstractGui.fill(x - 6, y - 6, x + l + 6, y + 37, 0x44000000); AbstractGui.fill(x - 4, y - 4, x + l + 4, y + 35, 0x44000000); @@ -384,19 +384,19 @@ public final class HUDHandler { GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); Minecraft mc = Minecraft.getInstance(); - int x = mc.mainWindow.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(name) / 2; - int y = mc.mainWindow.getScaledHeight() / 2 + 10; + int x = mc.getWindow().getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(name) / 2; + int y = mc.getWindow().getScaledHeight() / 2 + 10; mc.fontRenderer.drawStringWithShadow(name, x, y, color); - x = mc.mainWindow.getScaledWidth() / 2 - 51; + x = mc.getWindow().getScaledWidth() / 2 - 51; y += 10; renderManaBar(x, y, color, mana < 0 ? 0.5F : 1F, mana, maxMana); if(mana < 0) { String text = I18n.format("botaniamisc.statusUnknown"); - x = mc.mainWindow.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(text) / 2; + x = mc.getWindow().getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(text) / 2; y -= 1; mc.fontRenderer.drawString(text, x, y, color); } @@ -409,8 +409,8 @@ public final class HUDHandler { Minecraft mc = Minecraft.getInstance(); - int x = mc.mainWindow.getScaledWidth() / 2 + 55; - int y = mc.mainWindow.getScaledHeight() / 2 + 12; + int x = mc.getWindow().getScaledWidth() / 2 + 55; + int y = mc.getWindow().getScaledHeight() / 2 + 12; net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting(); GlStateManager.enableRescaleNormal(); diff --git a/src/main/java/vazkii/botania/client/core/handler/ItemsRemainingRenderHandler.java b/src/main/java/vazkii/botania/client/core/handler/ItemsRemainingRenderHandler.java index 8f3ca7ebe..20c476b5e 100644 --- a/src/main/java/vazkii/botania/client/core/handler/ItemsRemainingRenderHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/ItemsRemainingRenderHandler.java @@ -36,8 +36,8 @@ public final class ItemsRemainingRenderHandler { if(ticks > 0 && !stack.isEmpty()) { int pos = maxTicks - ticks; Minecraft mc = Minecraft.getInstance(); - int x = mc.mainWindow.getScaledWidth() / 2 + 10 + Math.max(0, pos - leaveTicks); - int y = mc.mainWindow.getScaledHeight() / 2; + int x = mc.getWindow().getScaledWidth() / 2 + 10 + Math.max(0, pos - leaveTicks); + int y = mc.getWindow().getScaledHeight() / 2; int start = maxTicks - leaveTicks; float alpha = ticks + partTicks > start ? 1F : (ticks + partTicks) / start; diff --git a/src/main/java/vazkii/botania/client/core/handler/LightningHandler.java b/src/main/java/vazkii/botania/client/core/handler/LightningHandler.java index c4467aa83..9f0c0434f 100644 --- a/src/main/java/vazkii/botania/client/core/handler/LightningHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/LightningHandler.java @@ -53,9 +53,9 @@ public class LightningHandler { Entity entity = Minecraft.getInstance().player; TextureManager render = Minecraft.getInstance().textureManager; - double interpPosX = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * frame; - double interpPosY = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * frame; - double interpPosZ = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * frame; + double interpPosX = entity.lastTickPosX + (entity.getX() - entity.lastTickPosX) * frame; + double interpPosY = entity.lastTickPosY + (entity.getY() - entity.lastTickPosY) * frame; + double interpPosZ = entity.lastTickPosZ + (entity.getZ() - entity.lastTickPosZ) * frame; GlStateManager.pushMatrix(); GlStateManager.translated(-interpPosX, -interpPosY, -interpPosZ); diff --git a/src/main/java/vazkii/botania/client/core/handler/MiscellaneousIcons.java b/src/main/java/vazkii/botania/client/core/handler/MiscellaneousIcons.java index f6d786a3e..6df4b7999 100644 --- a/src/main/java/vazkii/botania/client/core/handler/MiscellaneousIcons.java +++ b/src/main/java/vazkii/botania/client/core/handler/MiscellaneousIcons.java @@ -19,11 +19,7 @@ import net.minecraft.fluid.Fluids; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.ModelBakeEvent; import net.minecraftforge.client.event.TextureStitchEvent; -import net.minecraftforge.client.model.BasicState; -import net.minecraftforge.client.model.ForgeBlockStateV1; -import net.minecraftforge.client.model.ModelDynBucket; import net.minecraftforge.client.model.ModelLoader; -import net.minecraftforge.common.model.IModelState; import net.minecraftforge.eventbus.api.SubscribeEvent; import vazkii.botania.client.model.FloatingFlowerModel; import vazkii.botania.client.model.GunModel; @@ -140,7 +136,7 @@ public class MiscellaneousIcons { @SubscribeEvent public void onTextureStitchPre(TextureStitchEvent.Pre evt) { - if(evt.getMap() != Minecraft.getInstance().getTextureMap()) + if(!evt.getMap().getId().equals(AtlasTexture.LOCATION_BLOCKS_TEXTURE)) return; evt.addSprite(prefix("blocks/alfheim_portal_swirl")); @@ -202,7 +198,7 @@ public class MiscellaneousIcons { @SubscribeEvent public void onTextureStitchPost(TextureStitchEvent.Post evt) { - if(evt.getMap() != Minecraft.getInstance().getTextureMap()) + if(!evt.getMap().getId().equals(AtlasTexture.LOCATION_BLOCKS_TEXTURE)) return; alfPortalTex = get(evt.getMap(), "blocks/alfheim_portal_swirl"); diff --git a/src/main/java/vazkii/botania/client/core/helper/ShaderHelper.java b/src/main/java/vazkii/botania/client/core/helper/ShaderHelper.java index c69a59d84..e4c7741cb 100644 --- a/src/main/java/vazkii/botania/client/core/helper/ShaderHelper.java +++ b/src/main/java/vazkii/botania/client/core/helper/ShaderHelper.java @@ -20,6 +20,7 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.ModList; import org.apache.commons.lang3.StringUtils; import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL20; import org.lwjgl.system.MemoryUtil; import vazkii.botania.api.internal.ShaderCallback; import vazkii.botania.client.core.handler.ClientTickHandler; @@ -57,7 +58,7 @@ public final class ShaderHelper { private static void deleteProgram(int id) { if (id != 0) { - GLX.glDeleteProgram(id); + GlStateManager.deleteProgram(id); } } @@ -119,11 +120,11 @@ public final class ShaderHelper { lighting = GL11.glGetBoolean(GL11.GL_LIGHTING); GlStateManager.disableLighting(); - GLX.glUseProgram(shader); + GlStateManager.useProgram(shader); if(shader != 0) { - int time = GLX.glGetUniformLocation(shader, "time"); - GLX.glUniform1i(time, ClientTickHandler.ticksInGame); + int time = GlStateManager.getUniformLocation(shader, "time"); + GlStateManager.uniform1(time, ClientTickHandler.ticksInGame); if(callback != null) callback.call(shader); @@ -157,29 +158,29 @@ public final class ShaderHelper { private static int createProgram(IResourceManager manager, String vert, String frag) { int vertId = 0, fragId = 0, program; if(vert != null) - vertId = createShader(manager, vert, GLX.GL_VERTEX_SHADER); + vertId = createShader(manager, vert, GL20.GL_VERTEX_SHADER); if(frag != null) - fragId = createShader(manager, frag, GLX.GL_FRAGMENT_SHADER); + fragId = createShader(manager, frag, GL20.GL_FRAGMENT_SHADER); - program = GLX.glCreateProgram(); + program = GlStateManager.createProgram(); if(program == 0) return 0; if(vert != null) - GLX.glAttachShader(program, vertId); + GlStateManager.attachShader(program, vertId); if(frag != null) - GLX.glAttachShader(program, fragId); + GlStateManager.attachShader(program, fragId); - GLX.glLinkProgram(program); - if (GLX.glGetProgrami(program, GLX.GL_LINK_STATUS) == GL11.GL_FALSE) { + GlStateManager.linkProgram(program); + if (GlStateManager.getProgram(program, GL20.GL_LINK_STATUS) == GL11.GL_FALSE) { Botania.LOGGER.warn("Error encountered when linking program containing VS {} and FS {}. Log output:", vert, frag); - Botania.LOGGER.warn(GLX.glGetProgramInfoLog(program, 32768)); + Botania.LOGGER.warn(GlStateManager.getProgramInfoLog(program, 32768)); return 0; } // Free the shader immediately, it will stay alive until the program is deleted - GLX.glDeleteShader(vertId); - GLX.glDeleteShader(fragId); + GlStateManager.deleteShader(vertId); + GlStateManager.deleteShader(fragId); return program; } @@ -187,22 +188,22 @@ public final class ShaderHelper { private static int createShader(IResourceManager manager, String filename, int shaderType){ int shader = 0; try { - shader = GLX.glCreateShader(shaderType); + shader = GlStateManager.createShader(shaderType); if(shader == 0) return 0; - GLX.glShaderSource(shader, readFileAsString(manager, filename)); - GLX.glCompileShader(shader); + GlStateManager.shaderSource(shader, readFileAsString(manager, filename)); + GlStateManager.compileShader(shader); - if (GLX.glGetShaderi(shader, GLX.GL_COMPILE_STATUS) == GL11.GL_FALSE) { - String s1 = StringUtils.trim(GLX.glGetShaderInfoLog(shader, 32768)); + if (GlStateManager.getShader(shader, GL20.GL_COMPILE_STATUS) == GL11.GL_FALSE) { + String s1 = StringUtils.trim(GlStateManager.getShaderInfoLog(shader, 32768)); throw new IOException("Couldn't compile " + filename + ": " + s1); } return shader; } catch(Exception e) { - GLX.glDeleteShader(shader); + GlStateManager.deleteShader(shader); e.printStackTrace(); return -1; } diff --git a/src/main/java/vazkii/botania/client/fx/FXLightning.java b/src/main/java/vazkii/botania/client/fx/FXLightning.java index 88d35c0a5..c9471c8c4 100644 --- a/src/main/java/vazkii/botania/client/fx/FXLightning.java +++ b/src/main/java/vazkii/botania/client/fx/FXLightning.java @@ -254,7 +254,7 @@ public class FXLightning extends Particle { private static Vector3 getRelativeViewVector(Vector3 pos) { Entity renderEntity = Minecraft.getInstance().getRenderViewEntity(); - return new Vector3((float) renderEntity.posX - pos.x, (float) renderEntity.posY + renderEntity.getEyeHeight() - pos.y, (float) renderEntity.posZ - pos.z); + return new Vector3((float) renderEntity.getX() - pos.x, (float) renderEntity.getY() + renderEntity.getEyeHeight() - pos.y, (float) renderEntity.getZ() - pos.z); } } diff --git a/src/main/java/vazkii/botania/client/fx/FXWisp.java b/src/main/java/vazkii/botania/client/fx/FXWisp.java index fbbc30aec..8d6037924 100644 --- a/src/main/java/vazkii/botania/client/fx/FXWisp.java +++ b/src/main/java/vazkii/botania/client/fx/FXWisp.java @@ -91,9 +91,9 @@ public class FXWisp extends Particle { // [VanillaCopy] of super, without drag when onGround is true @Override public void tick() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; + this.prevPosX = this.getX(); + this.prevPosY = this.getY(); + this.prevPosZ = this.getZ(); if (this.age++ >= this.maxAge) { diff --git a/src/main/java/vazkii/botania/client/model/FloatingFlowerModel.java b/src/main/java/vazkii/botania/client/model/FloatingFlowerModel.java index e09d5236c..653d55caa 100644 --- a/src/main/java/vazkii/botania/client/model/FloatingFlowerModel.java +++ b/src/main/java/vazkii/botania/client/model/FloatingFlowerModel.java @@ -1,11 +1,14 @@ package vazkii.botania.client.model; import com.google.common.collect.ImmutableMap; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.datafixers.util.Pair; import net.minecraft.block.BlockState; import net.minecraft.client.renderer.model.BakedQuad; import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.renderer.model.IUnbakedModel; import net.minecraft.client.renderer.model.ItemCameraTransforms; +import net.minecraft.client.renderer.model.Material; import net.minecraft.client.renderer.model.ModelBakery; import net.minecraft.client.renderer.texture.ISprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite; @@ -22,15 +25,12 @@ import net.minecraftforge.client.model.data.EmptyModelData; import net.minecraftforge.client.model.data.IModelData; import net.minecraftforge.common.model.IModelState; import net.minecraftforge.common.model.TRSRTransformation; -import org.apache.commons.lang3.tuple.Pair; import vazkii.botania.api.BotaniaAPIClient; import vazkii.botania.api.item.IFloatingFlower; import vazkii.botania.api.state.BotaniaStateProps; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import javax.vecmath.Matrix4f; -import javax.vecmath.Vector3f; import java.util.ArrayList; import java.util.Collection; import java.util.EnumMap; @@ -74,12 +74,12 @@ public class FloatingFlowerModel implements IUnbakedModel { @Nonnull @Override - public Collection getTextures(@Nonnull Function modelGetter, @Nonnull Set missingTextureErrors) { - Set ret = new HashSet<>(); + public Collection getTextureDependencies(Function modelGetter, Set> missingTextureErrors){ + Set ret = new HashSet<>(); for (IUnbakedModel island : unbakedIslands.values()) { - ret.addAll(island.getTextures(modelGetter, missingTextureErrors)); + ret.addAll(island.getTextureDependencies(modelGetter, missingTextureErrors)); } - ret.addAll(unbakedFlower.getTextures(modelGetter, missingTextureErrors)); + ret.addAll(unbakedFlower.getTextureDependencies(modelGetter, missingTextureErrors)); return ret; } @@ -158,10 +158,10 @@ public class FloatingFlowerModel implements IUnbakedModel { @Nonnull @Override - public Pair handlePerspective(@Nonnull ItemCameraTransforms.TransformType cameraTransformType) { + public IBakedModel handlePerspective(@Nonnull ItemCameraTransforms.TransformType cameraTransformType, MatrixStack ms) { // Use the item transforms from the islands since it looks better - Pair p = this.islands.values().iterator().next().handlePerspective(cameraTransformType); - return Pair.of(this, p.getRight()); + this.islands.values().iterator().next().handlePerspective(cameraTransformType, ms); + return this; } } diff --git a/src/main/java/vazkii/botania/client/model/GunModel.java b/src/main/java/vazkii/botania/client/model/GunModel.java index f9d812cbb..a1560ad10 100644 --- a/src/main/java/vazkii/botania/client/model/GunModel.java +++ b/src/main/java/vazkii/botania/client/model/GunModel.java @@ -1,9 +1,13 @@ package vazkii.botania.client.model; import com.google.common.base.Preconditions; +import com.mojang.blaze3d.matrix.MatrixStack; import net.minecraft.block.BlockState; import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.TransformationMatrix; +import net.minecraft.client.renderer.Vector3f; import net.minecraft.client.renderer.model.BakedQuad; +import net.minecraft.client.renderer.model.BlockModel; import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.renderer.model.IUnbakedModel; import net.minecraft.client.renderer.model.ItemCameraTransforms; @@ -14,20 +18,22 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.entity.LivingEntity; import net.minecraft.item.ItemStack; +import net.minecraft.resources.IResource; import net.minecraft.util.Direction; +import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; -import net.minecraftforge.client.model.BasicState; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.client.model.ModelLoaderRegistry; -import net.minecraftforge.common.model.TRSRTransformation; +import net.minecraftforge.client.model.SimpleModelTransform; import org.apache.commons.lang3.tuple.Pair; +import vazkii.botania.common.Botania; import vazkii.botania.common.item.ItemManaGun; import vazkii.botania.common.lib.LibMisc; import javax.annotation.Nonnull; import javax.annotation.Nullable; -import javax.vecmath.Matrix4f; -import javax.vecmath.Vector3f; +import java.io.IOException; +import java.io.InputStreamReader; import java.util.ArrayList; import java.util.EnumMap; import java.util.HashMap; @@ -35,6 +41,8 @@ import java.util.List; import java.util.Map; import java.util.Random; +import static vazkii.botania.common.lib.ResourceLocationHelper.prefix; + public class GunModel implements IBakedModel { private static final ModelResourceLocation DESU = new ModelResourceLocation(LibMisc.MOD_ID + ":desu_gun", "inventory"); private static final ModelResourceLocation DESU_CLIP = new ModelResourceLocation(LibMisc.MOD_ID + ":desu_gun_clip", "inventory"); @@ -62,8 +70,15 @@ public class GunModel implements IBakedModel { ItemStack lens = ItemManaGun.getLens(stack); if(!lens.isEmpty()) { // TODO 1.14 : currently broken because it goes through the vanilla codepath which doesn't handle builtin/generated models - ModelResourceLocation mrl = new ModelResourceLocation(lens.getItem().getRegistryName(), "inventory"); - IUnbakedModel unbaked = ModelLoaderRegistry.getModelOrMissing(mrl); + // todo 1.15 : check above statement lol + ResourceLocation loc = new ResourceLocation(lens.getItem().getRegistryName().getNamespace(), "models/item/" + lens.getItem().getRegistryName().getPath() + ".json"); + IUnbakedModel unbaked; + try (IResource json = Minecraft.getInstance().getResourceManager().getResource(loc)) { + unbaked = BlockModel.deserialize(new InputStreamReader(json.getInputStream())); + } catch (IOException e) { + Botania.LOGGER.error("Missing flower model {}", loc); + unbaked = BlockModel.deserialize(ModelBakery.MISSING_MODEL_MESH); + } return GunModel.this.getModel(unbaked, clip); } else return clip ? originalModelClip : originalModel; @@ -98,8 +113,8 @@ public class GunModel implements IBakedModel { CompositeBakedModel(ModelBakery bakery, IUnbakedModel lensUnbaked, IBakedModel gun) { this.gun = gun; - final TRSRTransformation transform = new TRSRTransformation(new Vector3f(-0.2F, 0.4F, 0.8F), TRSRTransformation.quatFromXYZ(0, (float) Math.PI / 2, 0), new Vector3f(0.625F, 0.625F, 0.625F), null); - IBakedModel lens = lensUnbaked.bake(bakery, ModelLoader.defaultTextureGetter(), new BasicState(transform, false), DefaultVertexFormats.ITEM); + final TransformationMatrix transform = new TransformationMatrix(new Vector3f(-0.2F, 0.4F, 0.8F), Vector3f.POSITIVE_Y.getDegreesQuaternion((float) Math.PI / 2), new Vector3f(0.625F, 0.625F, 0.625F), null); + IBakedModel lens = lensUnbaked.bake(bakery, ModelLoader.defaultTextureGetter(), new SimpleModelTransform(transform), prefix("gun_lens_" + lensUnbaked.toString())); for(Direction e : Direction.values()) faceQuads.put(e, new ArrayList<>()); @@ -132,11 +147,10 @@ public class GunModel implements IBakedModel { @Nonnull @Override public ItemOverrideList getOverrides() { return ItemOverrideList.EMPTY; } @Override - public Pair handlePerspective(@Nonnull ItemCameraTransforms.TransformType cameraTransformType) { - Pair pair = gun.handlePerspective(cameraTransformType); - if(pair != null && pair.getRight() != null) - return Pair.of(this, pair.getRight()); - return Pair.of(this, TRSRTransformation.identity().getMatrixVec()); + public IBakedModel handlePerspective(@Nonnull ItemCameraTransforms.TransformType cameraTransformType, MatrixStack stack) { + // apply gun transforms to stack but use self model still + gun.handlePerspective(cameraTransformType, stack); + return this; } } diff --git a/src/main/java/vazkii/botania/client/model/LexiconModel.java b/src/main/java/vazkii/botania/client/model/LexiconModel.java index d4ecb8be9..9e7de5b94 100644 --- a/src/main/java/vazkii/botania/client/model/LexiconModel.java +++ b/src/main/java/vazkii/botania/client/model/LexiconModel.java @@ -1,6 +1,7 @@ package vazkii.botania.client.model; import com.google.common.collect.ImmutableList; +import com.mojang.blaze3d.matrix.MatrixStack; import net.minecraft.block.BlockState; import net.minecraft.client.renderer.model.BakedQuad; import net.minecraft.client.renderer.model.IBakedModel; @@ -12,7 +13,6 @@ import org.apache.commons.lang3.tuple.Pair; import vazkii.botania.common.core.handler.ConfigHandler; import javax.annotation.Nonnull; -import javax.vecmath.Matrix4f; import java.util.List; import java.util.Random; @@ -25,12 +25,12 @@ public class LexiconModel implements IBakedModel { @Nonnull @Override - public Pair handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) { + public IBakedModel handlePerspective(ItemCameraTransforms.TransformType cameraTransformType, MatrixStack stack) { if((cameraTransformType == ItemCameraTransforms.TransformType.FIRST_PERSON_RIGHT_HAND || cameraTransformType == ItemCameraTransforms.TransformType.FIRST_PERSON_LEFT_HAND) && ConfigHandler.CLIENT.lexicon3dModel.get()) - return Pair.of(this, null); - return original.handlePerspective(cameraTransformType); + return this; + return original.handlePerspective(cameraTransformType, stack); } @Nonnull @Override public List getQuads(BlockState state, Direction side, @Nonnull Random rand) { return ImmutableList.of(); } diff --git a/src/main/java/vazkii/botania/client/model/ModelAvatar.java b/src/main/java/vazkii/botania/client/model/ModelAvatar.java index 21f30d5d3..b20108acf 100644 --- a/src/main/java/vazkii/botania/client/model/ModelAvatar.java +++ b/src/main/java/vazkii/botania/client/model/ModelAvatar.java @@ -10,43 +10,43 @@ */ package vazkii.botania.client.model; -import net.minecraft.client.renderer.entity.model.RendererModel; import net.minecraft.client.renderer.model.Model; +import net.minecraft.client.renderer.model.ModelRenderer; public class ModelAvatar extends Model { - public final RendererModel body; - public final RendererModel rightarm; - public final RendererModel leftarm; - public final RendererModel rightleg; - public final RendererModel leftleg; - public final RendererModel head; + public final ModelRenderer body; + public final ModelRenderer rightarm; + public final ModelRenderer leftarm; + public final ModelRenderer rightleg; + public final ModelRenderer leftleg; + public final ModelRenderer head; public ModelAvatar() { textureWidth = 32; textureHeight = 32; - leftleg = new RendererModel(this, 0, 20); + leftleg = new ModelRenderer(this, 0, 20); leftleg.mirror = true; leftleg.setRotationPoint(1.5F, 18.0F, -0.5F); - leftleg.addBox(-1.5F, 0.0F, -1.5F, 3, 6, 3, 0.0F); - rightarm = new RendererModel(this, 0, 20); + leftleg.addCuboid(-1.5F, 0.0F, -1.5F, 3, 6, 3, 0.0F); + rightarm = new ModelRenderer(this, 0, 20); rightarm.setRotationPoint(-3.0F, 15.0F, -1.0F); - rightarm.addBox(-2.0F, -1.0F, -1.0F, 2, 6, 3, 0.0F); + rightarm.addCuboid(-2.0F, -1.0F, -1.0F, 2, 6, 3, 0.0F); setRotateAngle(rightarm, 0.0F, -0.0F, 0.08726646259971647F); - leftarm = new RendererModel(this, 0, 20); + leftarm = new ModelRenderer(this, 0, 20); leftarm.mirror = true; leftarm.setRotationPoint(3.0F, 15.0F, -1.0F); - leftarm.addBox(0.0F, -1.0F, -1.0F, 2, 6, 3, 0.0F); + leftarm.addCuboid(0.0F, -1.0F, -1.0F, 2, 6, 3, 0.0F); setRotateAngle(leftarm, 0.0F, -0.0F, -0.08726646259971647F); - head = new RendererModel(this, 0, 0); + head = new ModelRenderer(this, 0, 0); head.setRotationPoint(0.0F, 14.0F, 0.0F); - head.addBox(-3.0F, -6.0F, -3.0F, 6, 6, 6, 0.0F); - rightleg = new RendererModel(this, 0, 20); + head.addCuboid(-3.0F, -6.0F, -3.0F, 6, 6, 6, 0.0F); + rightleg = new ModelRenderer(this, 0, 20); rightleg.setRotationPoint(-1.5F, 18.0F, -0.5F); - rightleg.addBox(-1.5F, 0.0F, -1.5F, 3, 6, 3, 0.0F); - body = new RendererModel(this, 0, 12); + rightleg.addCuboid(-1.5F, 0.0F, -1.5F, 3, 6, 3, 0.0F); + body = new ModelRenderer(this, 0, 12); body.setRotationPoint(0.0F, 14.0F, 0.0F); - body.addBox(-3.0F, 0.0F, -2.0F, 6, 4, 4, 0.0F); + body.addCuboid(-3.0F, 0.0F, -2.0F, 6, 4, 4, 0.0F); } public void render() { @@ -59,7 +59,7 @@ public class ModelAvatar extends Model { body.render(f5); } - public void setRotateAngle(RendererModel modelRenderer, float x, float y, float z) { + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; diff --git a/src/main/java/vazkii/botania/client/model/ModelBellows.java b/src/main/java/vazkii/botania/client/model/ModelBellows.java index 141218da3..673b7db84 100644 --- a/src/main/java/vazkii/botania/client/model/ModelBellows.java +++ b/src/main/java/vazkii/botania/client/model/ModelBellows.java @@ -11,33 +11,33 @@ package vazkii.botania.client.model; import com.mojang.blaze3d.platform.GlStateManager; -import net.minecraft.client.renderer.entity.model.RendererModel; import net.minecraft.client.renderer.model.Model; +import net.minecraft.client.renderer.model.ModelRenderer; public class ModelBellows extends Model { - final RendererModel top; - final RendererModel base; - final RendererModel pipe; - final RendererModel funnel; + final ModelRenderer top; + final ModelRenderer base; + final ModelRenderer pipe; + final ModelRenderer funnel; public ModelBellows() { textureWidth = 64; textureHeight = 32; - top = new RendererModel(this, 0, 0); + top = new ModelRenderer(this, 0, 0); top.setRotationPoint(0.0F, 16.0F, 0.0F); - top.addBox(-4.0F, -2.0F, -4.0F, 8, 1, 8, 0.0F); - base = new RendererModel(this, 0, 9); + top.addCuboid(-4.0F, -2.0F, -4.0F, 8, 1, 8, 0.0F); + base = new ModelRenderer(this, 0, 9); base.setRotationPoint(0.0F, 16.0F, 0.0F); - base.addBox(-5.0F, 6.0F, -5.0F, 10, 2, 10, 0.0F); - pipe = new RendererModel(this, 0, 21); + base.addCuboid(-5.0F, 6.0F, -5.0F, 10, 2, 10, 0.0F); + pipe = new ModelRenderer(this, 0, 21); pipe.setRotationPoint(0.0F, 16.0F, 0.0F); - pipe.addBox(-1.0F, 6.0F, -8.0F, 2, 2, 3, 0.0F); + pipe.addCuboid(-1.0F, 6.0F, -8.0F, 2, 2, 3, 0.0F); - funnel = new RendererModel(this, 40, 0); + funnel = new ModelRenderer(this, 40, 0); funnel.setRotationPoint(0.0F, 0.0F, 0.0F); - funnel.addBox(0.0F, 0.0F, 0.0F, 6, 7, 6, 0.0F); + funnel.addCuboid(0.0F, 0.0F, 0.0F, 6, 7, 6, 0.0F); } public void render(float fract) { diff --git a/src/main/java/vazkii/botania/client/model/ModelBrewery.java b/src/main/java/vazkii/botania/client/model/ModelBrewery.java index 3594f6d8c..3c9323f3c 100644 --- a/src/main/java/vazkii/botania/client/model/ModelBrewery.java +++ b/src/main/java/vazkii/botania/client/model/ModelBrewery.java @@ -11,36 +11,36 @@ package vazkii.botania.client.model; import com.mojang.blaze3d.platform.GlStateManager; -import net.minecraft.client.renderer.entity.model.RendererModel; import net.minecraft.client.renderer.model.Model; +import net.minecraft.client.renderer.model.ModelRenderer; import vazkii.botania.client.render.tile.RenderTileBrewery; public class ModelBrewery extends Model { - final RendererModel top; - final RendererModel pole; - final RendererModel bottom; + final ModelRenderer top; + final ModelRenderer pole; + final ModelRenderer bottom; - final RendererModel plate; + final ModelRenderer plate; public ModelBrewery() { textureWidth = 32; textureHeight = 16; - top = new RendererModel(this, 8, 0); + top = new ModelRenderer(this, 8, 0); top.setRotationPoint(0.0F, 16.0F, 0.0F); - top.addBox(-2.0F, -7.0F, -2.0F, 4, 1, 4, 0.0F); - pole = new RendererModel(this, 0, 0); + top.addCuboid(-2.0F, -7.0F, -2.0F, 4, 1, 4, 0.0F); + pole = new ModelRenderer(this, 0, 0); pole.setRotationPoint(0.0F, 16.0F, 0.0F); - pole.addBox(-1.0F, -6.0F, -1.0F, 2, 10, 2, 0.0F); - bottom = new RendererModel(this, 8, 5); + pole.addCuboid(-1.0F, -6.0F, -1.0F, 2, 10, 2, 0.0F); + bottom = new ModelRenderer(this, 8, 5); bottom.setRotationPoint(0.0F, 16.0F, 0.0F); - bottom.addBox(-2.0F, 4.0F, -2.0F, 4, 1, 4, 0.0F); + bottom.addCuboid(-2.0F, 4.0F, -2.0F, 4, 1, 4, 0.0F); - plate = new RendererModel(this, 8, 5); + plate = new ModelRenderer(this, 8, 5); plate.setRotationPoint(0.0F, 17.0F, 0.0F); - plate.addBox(5.0F, 0.0F, -2.0F, 4, 1, 4, 0.0F); + plate.addCuboid(5.0F, 0.0F, -2.0F, 4, 1, 4, 0.0F); } diff --git a/src/main/java/vazkii/botania/client/model/ModelCloak.java b/src/main/java/vazkii/botania/client/model/ModelCloak.java index d20b197d9..284df56ae 100644 --- a/src/main/java/vazkii/botania/client/model/ModelCloak.java +++ b/src/main/java/vazkii/botania/client/model/ModelCloak.java @@ -1,7 +1,7 @@ package vazkii.botania.client.model; -import net.minecraft.client.renderer.entity.model.RendererModel; import net.minecraft.client.renderer.model.Model; +import net.minecraft.client.renderer.model.ModelRenderer; /** * armor_cloak - wiiv @@ -9,9 +9,9 @@ import net.minecraft.client.renderer.model.Model; */ public class ModelCloak extends Model { - public RendererModel collar; - public RendererModel sideL; - public RendererModel sideR; + public ModelRenderer collar; + public ModelRenderer sideL; + public ModelRenderer sideR; public ModelCloak() { @@ -19,18 +19,18 @@ public class ModelCloak extends Model { textureHeight = 64; float s = 0.01F; - collar = new RendererModel(this, 0, 0); + collar = new ModelRenderer(this, 0, 0); collar.setRotationPoint(0.0F, -3.0F, -4.5F); - collar.addBox(-5.5F, 0.0F, -1.5F, 11, 5, 11, s); + collar.addCuboid(-5.5F, 0.0F, -1.5F, 11, 5, 11, s); setRotateAngle(collar, 0.08726646259971647F, 0.0F, 0.0F); - sideL = new RendererModel(this, 0, 16); + sideL = new ModelRenderer(this, 0, 16); sideL.mirror = true; sideL.setRotationPoint(0.0F, 0.0F, 0.0F); - sideL.addBox(-0.5F, -0.5F, -5.5F, 11, 21, 10, s); + sideL.addCuboid(-0.5F, -0.5F, -5.5F, 11, 21, 10, s); setRotateAngle(sideL, 0.08726646259971647F, -0.08726646259971647F, -0.17453292519943295F); - sideR = new RendererModel(this, 0, 16); + sideR = new ModelRenderer(this, 0, 16); sideR.setRotationPoint(0.0F, 0.0F, 0.0F); - sideR.addBox(-10.5F, -0.5F, -5.5F, 11, 21, 10, s); + sideR.addCuboid(-10.5F, -0.5F, -5.5F, 11, 21, 10, s); setRotateAngle(sideR, 0.08726646259971647F, 0.08726646259971647F, 0.17453292519943295F); } @@ -41,7 +41,7 @@ public class ModelCloak extends Model { sideR.render(f5); } - public void setRotateAngle(RendererModel modelRenderer, float x, float y, float z) { + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; diff --git a/src/main/java/vazkii/botania/client/model/ModelHourglass.java b/src/main/java/vazkii/botania/client/model/ModelHourglass.java index 3d56461c3..40dae7cac 100644 --- a/src/main/java/vazkii/botania/client/model/ModelHourglass.java +++ b/src/main/java/vazkii/botania/client/model/ModelHourglass.java @@ -11,50 +11,50 @@ package vazkii.botania.client.model; import com.mojang.blaze3d.platform.GlStateManager; -import net.minecraft.client.renderer.entity.model.RendererModel; import net.minecraft.client.renderer.model.Model; +import net.minecraft.client.renderer.model.ModelRenderer; import org.lwjgl.opengl.GL11; import java.awt.*; public class ModelHourglass extends Model { - public RendererModel top; - public RendererModel glassT; - public RendererModel ring; - public RendererModel glassB; - public RendererModel bottom; + public ModelRenderer top; + public ModelRenderer glassT; + public ModelRenderer ring; + public ModelRenderer glassB; + public ModelRenderer bottom; - public RendererModel sandT; - public RendererModel sandB; + public ModelRenderer sandT; + public ModelRenderer sandB; public ModelHourglass() { textureWidth = 64; textureHeight = 32; - top = new RendererModel(this, 20, 0); + top = new ModelRenderer(this, 20, 0); top.setRotationPoint(0.0F, 0.0F, 0.0F); - top.addBox(-3.0F, -6.5F, -3.0F, 6, 1, 6, 0.0F); - glassT = new RendererModel(this, 0, 0); + top.addCuboid(-3.0F, -6.5F, -3.0F, 6, 1, 6, 0.0F); + glassT = new ModelRenderer(this, 0, 0); glassT.setRotationPoint(0.0F, 0.0F, 0.0F); - glassT.addBox(-2.5F, -5.5F, -2.5F, 5, 5, 5, 0.0F); - ring = new RendererModel(this, 0, 20); + glassT.addCuboid(-2.5F, -5.5F, -2.5F, 5, 5, 5, 0.0F); + ring = new ModelRenderer(this, 0, 20); ring.setRotationPoint(0.0F, 0.0F, 0.0F); - ring.addBox(-1.5F, -0.5F, -1.5F, 3, 1, 3, 0.0F); - glassB = new RendererModel(this, 0, 10); + ring.addCuboid(-1.5F, -0.5F, -1.5F, 3, 1, 3, 0.0F); + glassB = new ModelRenderer(this, 0, 10); glassB.setRotationPoint(0.0F, 0.0F, 0.0F); - glassB.addBox(-2.5F, 0.5F, -2.5F, 5, 5, 5, 0.0F); - bottom = new RendererModel(this, 20, 7); + glassB.addCuboid(-2.5F, 0.5F, -2.5F, 5, 5, 5, 0.0F); + bottom = new ModelRenderer(this, 20, 7); bottom.setRotationPoint(0.0F, 0.0F, 0.0F); - bottom.addBox(-3.0F, 5.5F, -3.0F, 6, 1, 6, 0.0F); + bottom.addCuboid(-3.0F, 5.5F, -3.0F, 6, 1, 6, 0.0F); - sandT = new RendererModel(this, 20, 14); + sandT = new ModelRenderer(this, 20, 14); sandT.setRotationPoint(0.0F, 0.0F, 0.0F); - sandT.addBox(0.0F, 0.0F, 0.0F, 4, 4, 4, 0.0F); // -2.0F, -5.0F, -2.0F - sandB = new RendererModel(this, 20, 14); + sandT.addCuboid(0.0F, 0.0F, 0.0F, 4, 4, 4, 0.0F); // -2.0F, -5.0F, -2.0F + sandB = new ModelRenderer(this, 20, 14); sandB.setRotationPoint(0.0F, 0.0F, 0.0F); - sandB.addBox(0.0F, 0.0F, 0.0F, 4, 4, 4, 0.0F); // -2.0F, 1.0F, -2.05F + sandB.addCuboid(0.0F, 0.0F, 0.0F, 4, 4, 4, 0.0F); // -2.0F, 1.0F, -2.05F } public void render(float fract1, float fract2, boolean flip, int color) { diff --git a/src/main/java/vazkii/botania/client/model/ModelPixie.java b/src/main/java/vazkii/botania/client/model/ModelPixie.java index 68d2fd2e4..3f5746901 100644 --- a/src/main/java/vazkii/botania/client/model/ModelPixie.java +++ b/src/main/java/vazkii/botania/client/model/ModelPixie.java @@ -11,42 +11,42 @@ package vazkii.botania.client.model; import net.minecraft.client.renderer.entity.model.EntityModel; -import net.minecraft.client.renderer.entity.model.RendererModel; +import net.minecraft.client.renderer.model.ModelRenderer; import net.minecraft.util.math.MathHelper; import vazkii.botania.common.entity.EntityPixie; public class ModelPixie extends EntityModel { - public RendererModel body; - public RendererModel leftWingT; - public RendererModel leftWingB; - public RendererModel rightWingT; - public RendererModel rightWingB; + public ModelRenderer body; + public ModelRenderer leftWingT; + public ModelRenderer leftWingB; + public ModelRenderer rightWingT; + public ModelRenderer rightWingB; public ModelPixie() { textureWidth = 32; textureHeight = 32; - body = new RendererModel(this, 0, 0); + body = new ModelRenderer(this, 0, 0); body.setRotationPoint(0.0F, 16.0F, 0.0F); - body.addBox(-2.5F, 0.0F, -2.5F, 5, 5, 5, 0.0F); + body.addCuboid(-2.5F, 0.0F, -2.5F, 5, 5, 5, 0.0F); - leftWingT = new RendererModel(this, 0, 4); + leftWingT = new ModelRenderer(this, 0, 4); leftWingT.setRotationPoint(2.5F, 18.0F, 0.5F); - leftWingT.addBox(0.0F, -5.0F, 0.0F, 0, 5, 6, 0.0F); + leftWingT.addCuboid(0.0F, -5.0F, 0.0F, 0, 5, 6, 0.0F); setRotateAngle(leftWingT, 0.2617993877991494F, 0.5235987755982988F, 0.2617993877991494F); - leftWingB = new RendererModel(this, 0, 11); + leftWingB = new ModelRenderer(this, 0, 11); leftWingB.setRotationPoint(2.5F, 18.0F, 0.5F); - leftWingB.addBox(0.0F, 0.0F, 0.0F, 0, 3, 4, 0.0F); + leftWingB.addCuboid(0.0F, 0.0F, 0.0F, 0, 3, 4, 0.0F); setRotateAngle(leftWingB, -0.2617993877991494F, 0.2617993877991494F, -0.2617993877991494F); - rightWingT = new RendererModel(this, 0, 4); + rightWingT = new ModelRenderer(this, 0, 4); rightWingT.setRotationPoint(-2.5F, 18.0F, 0.5F); - rightWingT.addBox(0.0F, -5.0F, 0.0F, 0, 5, 6, 0.0F); + rightWingT.addCuboid(0.0F, -5.0F, 0.0F, 0, 5, 6, 0.0F); setRotateAngle(rightWingT, 0.2617993877991494F, -0.5235987755982988F, -0.2617993877991494F); - rightWingB = new RendererModel(this, 0, 11); + rightWingB = new ModelRenderer(this, 0, 11); rightWingB.setRotationPoint(-2.5F, 18.0F, 0.5F); - rightWingB.addBox(0.0F, 0.0F, 0.0F, 0, 3, 4, 0.0F); + rightWingB.addCuboid(0.0F, 0.0F, 0.0F, 0, 3, 4, 0.0F); setRotateAngle(rightWingB, -0.2617993877991494F, -0.2617993877991494F, 0.2617993877991494F); } @@ -54,7 +54,7 @@ public class ModelPixie extends EntityModel { public void render(EntityPixie entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); - setRotationAngles(entity, f, f1, f2, f3, f4, f5); + setAngles(entity, f, f1, f2, f3, f4); body.render(f5); @@ -64,16 +64,14 @@ public class ModelPixie extends EntityModel { rightWingB.render(f5); } - public void setRotateAngle(RendererModel modelRenderer, float x, float y, float z) { + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; } @Override - public void setRotationAngles(EntityPixie entity, float f, float f1, float f2, float f3, float f4, float f5) { - super.setRotationAngles(entity, f, f1, f2, f3, f4, f5); - + public void setAngles(EntityPixie entity, float f, float f1, float f2, float f3, float f4) { rightWingT.rotateAngleY = -(MathHelper.cos(f2 * 1.7F) * (float)Math.PI * 0.5F); leftWingT.rotateAngleY = MathHelper.cos(f2 * 1.7F) * (float)Math.PI * 0.5F; rightWingB.rotateAngleY = -(MathHelper.cos(f2 * 1.7F) * (float)Math.PI * 0.25F); diff --git a/src/main/java/vazkii/botania/client/model/ModelPylonGaia.java b/src/main/java/vazkii/botania/client/model/ModelPylonGaia.java index 72a157d42..9741e1ed5 100644 --- a/src/main/java/vazkii/botania/client/model/ModelPylonGaia.java +++ b/src/main/java/vazkii/botania/client/model/ModelPylonGaia.java @@ -10,25 +10,25 @@ */ package vazkii.botania.client.model; -import net.minecraft.client.renderer.entity.model.RendererModel; import net.minecraft.client.renderer.model.Model; +import net.minecraft.client.renderer.model.ModelRenderer; public class ModelPylonGaia extends Model implements IPylonModel { - private final RendererModel platef; - private final RendererModel plateb; - private final RendererModel platel; - private final RendererModel plater; + private final ModelRenderer platef; + private final ModelRenderer plateb; + private final ModelRenderer platel; + private final ModelRenderer plater; - private final RendererModel shardlbt; - private final RendererModel shardrbt; - private final RendererModel shardlft; - private final RendererModel shardrft; + private final ModelRenderer shardlbt; + private final ModelRenderer shardrbt; + private final ModelRenderer shardlft; + private final ModelRenderer shardrft; - private final RendererModel shardlbb; - private final RendererModel shardrbb; - private final RendererModel shardlfb; - private final RendererModel shardrfb; + private final ModelRenderer shardlbb; + private final ModelRenderer shardrbb; + private final ModelRenderer shardlfb; + private final ModelRenderer shardrfb; public ModelPylonGaia() { @@ -36,48 +36,48 @@ public class ModelPylonGaia extends Model implements IPylonModel { textureHeight = 64; //plates - platel = new RendererModel(this, 36, 0); + platel = new ModelRenderer(this, 36, 0); platel.setRotationPoint(0.0F, 16.0F, 0.0F); - platel.addBox(-3.0F, -3.0F, -8.0F, 6, 6, 2, 0.0F); + platel.addCuboid(-3.0F, -3.0F, -8.0F, 6, 6, 2, 0.0F); setRotation(platel, 0.0F, 1.5707963267948966F, 0.0F); - plater = new RendererModel(this, 36, 0); + plater = new ModelRenderer(this, 36, 0); plater.setRotationPoint(0.0F, 16.0F, 0.0F); - plater.addBox(-3.0F, -3.0F, -8.0F, 6, 6, 2, 0.0F); + plater.addCuboid(-3.0F, -3.0F, -8.0F, 6, 6, 2, 0.0F); setRotation(plater, 0.0F, -1.5707963267948966F, 0.0F); - platef = new RendererModel(this, 36, 0); + platef = new ModelRenderer(this, 36, 0); platef.setRotationPoint(0.0F, 16.0F, 0.0F); - platef.addBox(-3.0F, -3.0F, -8.0F, 6, 6, 2, 0.0F); - plateb = new RendererModel(this, 36, 0); + platef.addCuboid(-3.0F, -3.0F, -8.0F, 6, 6, 2, 0.0F); + plateb = new ModelRenderer(this, 36, 0); plateb.setRotationPoint(0.0F, 16.0F, 0.0F); - plateb.addBox(-3.0F, -3.0F, -8.0F, 6, 6, 2, 0.0F); + plateb.addCuboid(-3.0F, -3.0F, -8.0F, 6, 6, 2, 0.0F); setRotation(plateb, 0.0F, 3.141592653589793F, 0.0F); //shards - shardrft = new RendererModel(this, 16, 32); + shardrft = new ModelRenderer(this, 16, 32); shardrft.setRotationPoint(0.0F, 16.0F, 0.0F); - shardrft.addBox(2.0F, -6.0F, -5.0F, 3, 2, 3, 0.0F); - shardlbt = new RendererModel(this, 0, 0); + shardrft.addCuboid(2.0F, -6.0F, -5.0F, 3, 2, 3, 0.0F); + shardlbt = new ModelRenderer(this, 0, 0); shardlbt.setRotationPoint(0.0F, 16.0F, 0.0F); - shardlbt.addBox(-5.0F, -6.0F, 0.0F, 6, 5, 5, 0.0F); - shardrbt = new RendererModel(this, 22, 9); + shardlbt.addCuboid(-5.0F, -6.0F, 0.0F, 6, 5, 5, 0.0F); + shardrbt = new ModelRenderer(this, 22, 9); shardrbt.setRotationPoint(0.0F, 16.0F, 0.0F); - shardrbt.addBox(3.0F, -5.0F, 0.0F, 2, 4, 5, 0.0F); - shardlft = new RendererModel(this, 0, 32); + shardrbt.addCuboid(3.0F, -5.0F, 0.0F, 2, 4, 5, 0.0F); + shardlft = new ModelRenderer(this, 0, 32); shardlft.setRotationPoint(0.0F, 16.0F, 0.0F); - shardlft.addBox(-5.0F, -7.0F, -5.0F, 5, 6, 3, 0.0F); + shardlft.addCuboid(-5.0F, -7.0F, -5.0F, 5, 6, 3, 0.0F); - shardrfb = new RendererModel(this, 16, 37); + shardrfb = new ModelRenderer(this, 16, 37); shardrfb.setRotationPoint(0.0F, 16.0F, 0.0F); - shardrfb.addBox(2.0F, -2.0F, -5.0F, 3, 6, 3, 0.0F); - shardlbb = new RendererModel(this, 0, 10); + shardrfb.addCuboid(2.0F, -2.0F, -5.0F, 3, 6, 3, 0.0F); + shardlbb = new ModelRenderer(this, 0, 10); shardlbb.setRotationPoint(0.0F, 16.0F, 0.0F); - shardlbb.addBox(-5.0F, 1.0F, 0.0F, 6, 3, 5, 0.0F); - shardrbb = new RendererModel(this, 22, 0); + shardlbb.addCuboid(-5.0F, 1.0F, 0.0F, 6, 3, 5, 0.0F); + shardrbb = new ModelRenderer(this, 22, 0); shardrbb.setRotationPoint(0.0F, 16.0F, 0.0F); - shardrbb.addBox(3.0F, 1.0F, 0.0F, 2, 4, 5, 0.0F); - shardlfb = new RendererModel(this, 0, 41); + shardrbb.addCuboid(3.0F, 1.0F, 0.0F, 2, 4, 5, 0.0F); + shardlfb = new ModelRenderer(this, 0, 41); shardlfb.setRotationPoint(0.0F, 16.0F, 0.0F); - shardlfb.addBox(-5.0F, 1.0F, -5.0F, 5, 2, 3, 0.0F); + shardlfb.addCuboid(-5.0F, 1.0F, -5.0F, 5, 2, 3, 0.0F); } @Override @@ -105,7 +105,7 @@ public class ModelPylonGaia extends Model implements IPylonModel { plater.render(f); } - private void setRotation(RendererModel model, float x, float y, float z) { + private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; diff --git a/src/main/java/vazkii/botania/client/model/ModelPylonMana.java b/src/main/java/vazkii/botania/client/model/ModelPylonMana.java index 3a5570c34..d09b3ada8 100644 --- a/src/main/java/vazkii/botania/client/model/ModelPylonMana.java +++ b/src/main/java/vazkii/botania/client/model/ModelPylonMana.java @@ -10,20 +10,20 @@ */ package vazkii.botania.client.model; -import net.minecraft.client.renderer.entity.model.RendererModel; import net.minecraft.client.renderer.model.Model; +import net.minecraft.client.renderer.model.ModelRenderer; public class ModelPylonMana extends Model implements IPylonModel { - private final RendererModel platef; - private final RendererModel plateb; - private final RendererModel platel; - private final RendererModel plater; + private final ModelRenderer platef; + private final ModelRenderer plateb; + private final ModelRenderer platel; + private final ModelRenderer plater; - private final RendererModel shardlf; - private final RendererModel shardrf; - private final RendererModel shardlb; - private final RendererModel shardrb; + private final ModelRenderer shardlf; + private final ModelRenderer shardrf; + private final ModelRenderer shardlb; + private final ModelRenderer shardrb; public ModelPylonMana() { @@ -31,35 +31,35 @@ public class ModelPylonMana extends Model implements IPylonModel { textureHeight = 64; //plates - platef = new RendererModel(this, 36, 0); + platef = new ModelRenderer(this, 36, 0); platef.setRotationPoint(0.0F, 16.0F, 0.0F); - platef.addBox(-3.0F, -4.0F, -8.0F, 6, 8, 2, 0.0F); - plateb = new RendererModel(this, 36, 0); + platef.addCuboid(-3.0F, -4.0F, -8.0F, 6, 8, 2, 0.0F); + plateb = new ModelRenderer(this, 36, 0); plateb.setRotationPoint(0.0F, 16.0F, 0.0F); - plateb.addBox(-3.0F, -4.0F, -8.0F, 6, 8, 2, 0.0F); + plateb.addCuboid(-3.0F, -4.0F, -8.0F, 6, 8, 2, 0.0F); setRotation(plateb, 0.0F, 3.141592653589793F, 0.0F); - platel = new RendererModel(this, 36, 0); + platel = new ModelRenderer(this, 36, 0); platel.setRotationPoint(0.0F, 16.0F, 0.0F); - platel.addBox(-3.0F, -4.0F, -8.0F, 6, 8, 2, 0.0F); + platel.addCuboid(-3.0F, -4.0F, -8.0F, 6, 8, 2, 0.0F); setRotation(platel, 0.0F, 1.5707963267948966F, 0.0F); - plater = new RendererModel(this, 36, 0); + plater = new ModelRenderer(this, 36, 0); plater.setRotationPoint(0.0F, 16.0F, 0.0F); - plater.addBox(-3.0F, -4.0F, -8.0F, 6, 8, 2, 0.0F); + plater.addCuboid(-3.0F, -4.0F, -8.0F, 6, 8, 2, 0.0F); setRotation(plater, 0.0F, -1.5707963267948966F, 0.0F); //shards - shardlf = new RendererModel(this, 0, 21); + shardlf = new ModelRenderer(this, 0, 21); shardlf.setRotationPoint(0.0F, 16.0F, 0.0F); - shardlf.addBox(-5.0F, -9.0F, -5.0F, 5, 16, 3, 0.0F); - shardrf = new RendererModel(this, 16, 21); + shardlf.addCuboid(-5.0F, -9.0F, -5.0F, 5, 16, 3, 0.0F); + shardrf = new ModelRenderer(this, 16, 21); shardrf.setRotationPoint(0.0F, 16.0F, 0.0F); - shardrf.addBox(2.0F, -12.0F, -5.0F, 3, 16, 3, 0.0F); - shardlb = new RendererModel(this, 0, 0); + shardrf.addCuboid(2.0F, -12.0F, -5.0F, 3, 16, 3, 0.0F); + shardlb = new ModelRenderer(this, 0, 0); shardlb.setRotationPoint(0.0F, 16.0F, 0.0F); - shardlb.addBox(-5.0F, -10.0F, 0.0F, 6, 16, 5, 0.0F); - shardrb = new RendererModel(this, 22, 0); + shardlb.addCuboid(-5.0F, -10.0F, 0.0F, 6, 16, 5, 0.0F); + shardrb = new ModelRenderer(this, 22, 0); shardrb.setRotationPoint(0.0F, 16.0F, 0.0F); - shardrb.addBox(3.0F, -11.0F, 0.0F, 2, 16, 5, 0.0F); + shardrb.addCuboid(3.0F, -11.0F, 0.0F, 2, 16, 5, 0.0F); } @Override @@ -82,7 +82,7 @@ public class ModelPylonMana extends Model implements IPylonModel { plater.render(f); } - private void setRotation(RendererModel model, float x, float y, float z) { + private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; diff --git a/src/main/java/vazkii/botania/client/model/ModelPylonNatura.java b/src/main/java/vazkii/botania/client/model/ModelPylonNatura.java index fbfa1c665..a71bbc796 100644 --- a/src/main/java/vazkii/botania/client/model/ModelPylonNatura.java +++ b/src/main/java/vazkii/botania/client/model/ModelPylonNatura.java @@ -10,25 +10,25 @@ */ package vazkii.botania.client.model; -import net.minecraft.client.renderer.entity.model.RendererModel; import net.minecraft.client.renderer.model.Model; +import net.minecraft.client.renderer.model.ModelRenderer; public class ModelPylonNatura extends Model implements IPylonModel { - private final RendererModel platef; - private final RendererModel plateb; - private final RendererModel platel; - private final RendererModel plater; + private final ModelRenderer platef; + private final ModelRenderer plateb; + private final ModelRenderer platel; + private final ModelRenderer plater; - private final RendererModel shardlbt; - private final RendererModel shardrbt; - private final RendererModel shardlft; - private final RendererModel shardrft; + private final ModelRenderer shardlbt; + private final ModelRenderer shardrbt; + private final ModelRenderer shardlft; + private final ModelRenderer shardrft; - private final RendererModel shardlbb; - private final RendererModel shardrbb; - private final RendererModel shardlfb; - private final RendererModel shardrfb; + private final ModelRenderer shardlbb; + private final ModelRenderer shardrbb; + private final ModelRenderer shardlfb; + private final ModelRenderer shardrfb; public ModelPylonNatura() { @@ -36,48 +36,48 @@ public class ModelPylonNatura extends Model implements IPylonModel { textureHeight = 64; //plates - platef = new RendererModel(this, 36, 0); + platef = new ModelRenderer(this, 36, 0); platef.setRotationPoint(0.0F, 16.0F, 0.0F); - platef.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 2, 0.0F); - plateb = new RendererModel(this, 36, 0); + platef.addCuboid(-4.0F, -4.0F, -8.0F, 8, 8, 2, 0.0F); + plateb = new ModelRenderer(this, 36, 0); plateb.setRotationPoint(0.0F, 16.0F, 0.0F); - plateb.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 2, 0.0F); + plateb.addCuboid(-4.0F, -4.0F, -8.0F, 8, 8, 2, 0.0F); setRotation(plateb, 0.0F, 3.141592653589793F, 0.0F); - platel = new RendererModel(this, 36, 0); + platel = new ModelRenderer(this, 36, 0); platel.setRotationPoint(0.0F, 16.0F, 0.0F); - platel.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 2, 0.0F); + platel.addCuboid(-4.0F, -4.0F, -8.0F, 8, 8, 2, 0.0F); setRotation(platel, 0.0F, 1.5707963267948966F, 0.0F); - plater = new RendererModel(this, 36, 0); + plater = new ModelRenderer(this, 36, 0); plater.setRotationPoint(0.0F, 16.0F, 0.0F); - plater.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 2, 0.0F); + plater.addCuboid(-4.0F, -4.0F, -8.0F, 8, 8, 2, 0.0F); setRotation(plater, 0.0F, -1.5707963267948966F, 0.0F); //shards - shardrft = new RendererModel(this, 16, 32); + shardrft = new ModelRenderer(this, 16, 32); shardrft.setRotationPoint(0.0F, 16.0F, 0.0F); - shardrft.addBox(2.0F, -13.0F, -5.0F, 3, 7, 3, 0.0F); - shardlbt = new RendererModel(this, 0, 0); + shardrft.addCuboid(2.0F, -13.0F, -5.0F, 3, 7, 3, 0.0F); + shardlbt = new ModelRenderer(this, 0, 0); shardlbt.setRotationPoint(0.0F, 16.0F, 0.0F); - shardlbt.addBox(-5.0F, -11.0F, 0.0F, 6, 9, 5, 0.0F); - shardrbt = new RendererModel(this, 22, 0); + shardlbt.addCuboid(-5.0F, -11.0F, 0.0F, 6, 9, 5, 0.0F); + shardrbt = new ModelRenderer(this, 22, 0); shardrbt.setRotationPoint(0.0F, 16.0F, 0.0F); - shardrbt.addBox(3.0F, -12.0F, 0.0F, 2, 8, 5, 0.0F); - shardlft = new RendererModel(this, 0, 32); + shardrbt.addCuboid(3.0F, -12.0F, 0.0F, 2, 8, 5, 0.0F); + shardlft = new ModelRenderer(this, 0, 32); shardlft.setRotationPoint(0.0F, 16.0F, 0.0F); - shardlft.addBox(-5.0F, -10.0F, -5.0F, 5, 10, 3, 0.0F); + shardlft.addCuboid(-5.0F, -10.0F, -5.0F, 5, 10, 3, 0.0F); - shardrfb = new RendererModel(this, 16, 42); + shardrfb = new ModelRenderer(this, 16, 42); shardrfb.setRotationPoint(0.0F, 16.0F, 0.0F); - shardrfb.addBox(2.0F, -4.0F, -5.0F, 3, 9, 3, 0.0F); - shardlbb = new RendererModel(this, 0, 14); + shardrfb.addCuboid(2.0F, -4.0F, -5.0F, 3, 9, 3, 0.0F); + shardlbb = new ModelRenderer(this, 0, 14); shardlbb.setRotationPoint(0.0F, 16.0F, 0.0F); - shardlbb.addBox(-5.0F, 0.0F, 0.0F, 6, 7, 5, 0.0F); - shardrbb = new RendererModel(this, 22, 13); + shardlbb.addCuboid(-5.0F, 0.0F, 0.0F, 6, 7, 5, 0.0F); + shardrbb = new ModelRenderer(this, 22, 13); shardrbb.setRotationPoint(0.0F, 16.0F, 0.0F); - shardrbb.addBox(3.0F, -2.0F, 0.0F, 2, 8, 5, 0.0F); - shardlfb = new RendererModel(this, 0, 45); + shardrbb.addCuboid(3.0F, -2.0F, 0.0F, 2, 8, 5, 0.0F); + shardlfb = new ModelRenderer(this, 0, 45); shardlfb.setRotationPoint(0.0F, 16.0F, 0.0F); - shardlfb.addBox(-5.0F, 2.0F, -5.0F, 5, 6, 3, 0.0F); + shardlfb.addCuboid(-5.0F, 2.0F, -5.0F, 5, 6, 3, 0.0F); } @Override @@ -105,7 +105,7 @@ public class ModelPylonNatura extends Model implements IPylonModel { plater.render(f); } - private void setRotation(RendererModel model, float x, float y, float z) { + private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; diff --git a/src/main/java/vazkii/botania/client/model/ModelSpinningCubes.java b/src/main/java/vazkii/botania/client/model/ModelSpinningCubes.java index 659283156..d8e275fbd 100644 --- a/src/main/java/vazkii/botania/client/model/ModelSpinningCubes.java +++ b/src/main/java/vazkii/botania/client/model/ModelSpinningCubes.java @@ -12,18 +12,18 @@ package vazkii.botania.client.model; import com.mojang.blaze3d.platform.GLX; import com.mojang.blaze3d.platform.GlStateManager; -import net.minecraft.client.renderer.entity.model.RendererModel; import net.minecraft.client.renderer.model.Model; +import net.minecraft.client.renderer.model.ModelRenderer; import org.lwjgl.opengl.GL11; import vazkii.botania.client.core.handler.ClientTickHandler; public class ModelSpinningCubes extends Model { - private final RendererModel spinningCube; + private final ModelRenderer spinningCube; public ModelSpinningCubes() { - spinningCube = new RendererModel(this, 42, 0); - spinningCube.addBox(0F, 0F, 0F, 1, 1, 1); + spinningCube = new ModelRenderer(this, 42, 0); + spinningCube.addCuboid(0F, 0F, 0F, 1, 1, 1); spinningCube.setRotationPoint(0F, 0F, 0F); spinningCube.setTextureSize(64, 64); } diff --git a/src/main/java/vazkii/botania/client/model/ModelSpreader.java b/src/main/java/vazkii/botania/client/model/ModelSpreader.java index 981d9b42a..1eb222195 100644 --- a/src/main/java/vazkii/botania/client/model/ModelSpreader.java +++ b/src/main/java/vazkii/botania/client/model/ModelSpreader.java @@ -10,61 +10,61 @@ */ package vazkii.botania.client.model; -import net.minecraft.client.renderer.entity.model.RendererModel; import net.minecraft.client.renderer.model.Model; +import net.minecraft.client.renderer.model.ModelRenderer; public class ModelSpreader extends Model { - final RendererModel top; - final RendererModel sideL; - final RendererModel sideR; - final RendererModel bottom; - final RendererModel back; + final ModelRenderer top; + final ModelRenderer sideL; + final ModelRenderer sideR; + final ModelRenderer bottom; + final ModelRenderer back; - final RendererModel holeT; - final RendererModel holeL; - final RendererModel holeR; - final RendererModel holeB; + final ModelRenderer holeT; + final ModelRenderer holeL; + final ModelRenderer holeR; + final ModelRenderer holeB; - final RendererModel inside; + final ModelRenderer inside; public ModelSpreader() { textureWidth = 64; textureHeight = 64; - top = new RendererModel(this, 0, 0); + top = new ModelRenderer(this, 0, 0); top.setRotationPoint(0.0F, 16.0F, 0.0F); - top.addBox(-7.0F, -7.0F, -7.0F, 14, 1, 14, 0.0F); - sideL = new RendererModel(this, 0, 30); + top.addCuboid(-7.0F, -7.0F, -7.0F, 14, 1, 14, 0.0F); + sideL = new ModelRenderer(this, 0, 30); sideL.setRotationPoint(0.0F, 16.0F, 0.0F); - sideL.addBox(6.0F, -6.0F, -6.0F, 1, 12, 12, 0.0F); - sideR = new RendererModel(this, 0, 30); + sideL.addCuboid(6.0F, -6.0F, -6.0F, 1, 12, 12, 0.0F); + sideR = new ModelRenderer(this, 0, 30); sideR.setRotationPoint(0.0F, 16.0F, 0.0F); - sideR.addBox(-7.0F, -6.0F, -6.0F, 1, 12, 12, 0.0F); - back = new RendererModel(this, 0, 29); + sideR.addCuboid(-7.0F, -6.0F, -6.0F, 1, 12, 12, 0.0F); + back = new ModelRenderer(this, 0, 29); back.setRotationPoint(0.0F, 16.0F, 0.0F); - back.addBox(-7.0F, -6.0F, -7.0F, 14, 12, 1, 0.0F); - bottom = new RendererModel(this, 0, 15); + back.addCuboid(-7.0F, -6.0F, -7.0F, 14, 12, 1, 0.0F); + bottom = new ModelRenderer(this, 0, 15); bottom.setRotationPoint(0.0F, 16.0F, 0.0F); - bottom.addBox(-7.0F, 6.0F, -7.0F, 14, 1, 14, 0.0F); + bottom.addCuboid(-7.0F, 6.0F, -7.0F, 14, 1, 14, 0.0F); - holeT = new RendererModel(this, 0, 54); + holeT = new ModelRenderer(this, 0, 54); holeT.setRotationPoint(0.0F, 10.0F, 6.0F); - holeT.addBox(-7.0F, 0.0F, 0.0F, 14, 4, 1, 0.0F); - holeL = new RendererModel(this, 30, 54); + holeT.addCuboid(-7.0F, 0.0F, 0.0F, 14, 4, 1, 0.0F); + holeL = new ModelRenderer(this, 30, 54); holeL.setRotationPoint(2.0F, 10.0F, 6.0F); - holeL.addBox(0.0F, 4.0F, 0.0F, 5, 4, 1, 0.0F); - holeR = new RendererModel(this, 30, 59); + holeL.addCuboid(0.0F, 4.0F, 0.0F, 5, 4, 1, 0.0F); + holeR = new ModelRenderer(this, 30, 59); holeR.setRotationPoint(0.0F, 10.0F, 6.0F); - holeR.addBox(-7.0F, 4.0F, 0.0F, 5, 4, 1, 0.0F); - holeB = new RendererModel(this, 0, 59); + holeR.addCuboid(-7.0F, 4.0F, 0.0F, 5, 4, 1, 0.0F); + holeB = new ModelRenderer(this, 0, 59); holeB.setRotationPoint(0.0F, 18.0F, 6.0F); - holeB.addBox(-7.0F, 0.0F, 0.0F, 14, 4, 1, 0.0F); + holeB.addCuboid(-7.0F, 0.0F, 0.0F, 14, 4, 1, 0.0F); - inside = new RendererModel(this, 30, 30); + inside = new ModelRenderer(this, 30, 30); inside.setRotationPoint(0.0F, 16.0F, 0.0F); - inside.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6, 0.0F); + inside.addCuboid(-3.0F, -3.0F, -3.0F, 6, 6, 6, 0.0F); } public void render() { diff --git a/src/main/java/vazkii/botania/client/model/ModelTeruTeruBozu.java b/src/main/java/vazkii/botania/client/model/ModelTeruTeruBozu.java index 9102024dc..1bd683804 100644 --- a/src/main/java/vazkii/botania/client/model/ModelTeruTeruBozu.java +++ b/src/main/java/vazkii/botania/client/model/ModelTeruTeruBozu.java @@ -11,33 +11,33 @@ package vazkii.botania.client.model; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.entity.model.RendererModel; import net.minecraft.client.renderer.model.Model; +import net.minecraft.client.renderer.model.ModelRenderer; public class ModelTeruTeruBozu extends Model { - public final RendererModel thread; - public final RendererModel cloth; - public final RendererModel happyFace; - public final RendererModel sadFace; + public final ModelRenderer thread; + public final ModelRenderer cloth; + public final ModelRenderer happyFace; + public final ModelRenderer sadFace; public ModelTeruTeruBozu() { textureWidth = 64; textureHeight = 32; - sadFace = new RendererModel(this, 32, 0); + sadFace = new ModelRenderer(this, 32, 0); sadFace.setRotationPoint(0.0F, 14.5F, 0.0F); - sadFace.addBox(-4.0F, -6.0F, -4.0F, 8, 8, 8, 0.0F); + sadFace.addCuboid(-4.0F, -6.0F, -4.0F, 8, 8, 8, 0.0F); setRotateAngle(sadFace, 0.17453292519943295F, 0.0F, 0.0F); - happyFace = new RendererModel(this, 0, 0); + happyFace = new ModelRenderer(this, 0, 0); happyFace.setRotationPoint(0.0F, 14.5F, 0.0F); - happyFace.addBox(-4.0F, -6.0F, -4.0F, 8, 8, 8, 0.0F); + happyFace.addCuboid(-4.0F, -6.0F, -4.0F, 8, 8, 8, 0.0F); setRotateAngle(happyFace, -0.17453292519943295F, 0.0F, 0.0F); - thread = new RendererModel(this, 32, 16); + thread = new ModelRenderer(this, 32, 16); thread.setRotationPoint(0.0F, 14.0F, 0.0F); - thread.addBox(-3.0F, 2.0F, -3.0F, 6, 1, 6, 0.0F); - cloth = new RendererModel(this, 0, 16); + thread.addCuboid(-3.0F, 2.0F, -3.0F, 6, 1, 6, 0.0F); + cloth = new ModelRenderer(this, 0, 16); cloth.setRotationPoint(0.0F, 21.5F, -1.0F); - cloth.addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8, 0.0F); + cloth.addCuboid(-4.0F, -4.0F, -4.0F, 8, 8, 8, 0.0F); setRotateAngle(cloth, 0.7853981633974483F, 2.2689280275926285F, 1.5707963267948966F); } @@ -50,7 +50,7 @@ public class ModelTeruTeruBozu extends Model { cloth.render(f5); } - public void setRotateAngle(RendererModel modelRenderer, float x, float y, float z) { + public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; diff --git a/src/main/java/vazkii/botania/client/model/ModelTinyPotato.java b/src/main/java/vazkii/botania/client/model/ModelTinyPotato.java index 145a0960f..c0b81f4c2 100644 --- a/src/main/java/vazkii/botania/client/model/ModelTinyPotato.java +++ b/src/main/java/vazkii/botania/client/model/ModelTinyPotato.java @@ -10,19 +10,19 @@ */ package vazkii.botania.client.model; -import net.minecraft.client.renderer.entity.model.RendererModel; import net.minecraft.client.renderer.model.Model; +import net.minecraft.client.renderer.model.ModelRenderer; public class ModelTinyPotato extends Model { - final RendererModel potato; + final ModelRenderer potato; public ModelTinyPotato() { textureWidth = 16; textureHeight = 16; - potato = new RendererModel(this, 0, 0); - potato.addBox(0F, 0F, 0F, 4, 6, 4); + potato = new ModelRenderer(this, 0, 0); + potato.addCuboid(0F, 0F, 0F, 4, 6, 4); potato.setRotationPoint(-2F, 18F, -2F); potato.setTextureSize(64, 32); } diff --git a/src/main/java/vazkii/botania/client/model/armor/ModelArmor.java b/src/main/java/vazkii/botania/client/model/armor/ModelArmor.java index a2fad2ca6..3a3230d17 100644 --- a/src/main/java/vazkii/botania/client/model/armor/ModelArmor.java +++ b/src/main/java/vazkii/botania/client/model/armor/ModelArmor.java @@ -1,7 +1,7 @@ package vazkii.botania.client.model.armor; import net.minecraft.client.renderer.entity.model.BipedModel; -import net.minecraft.client.renderer.entity.model.RendererModel; +import net.minecraft.client.renderer.model.ModelRenderer; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.item.ArmorStandEntity; import net.minecraft.inventory.EquipmentSlotType; @@ -15,10 +15,11 @@ public class ModelArmor extends BipedModel { // [VanillaCopy] ArmorStandArmorModel.setRotationAngles because armor stands are dumb // This fixes the armor "breathing" and helmets always facing south on armor stands + // todo 1.15 recheck param names @Override - public void setRotationAngles(LivingEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor) { + public void setAngles(LivingEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { if (!(entity instanceof ArmorStandEntity)) { - super.setRotationAngles(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor); + super.setAngles(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch); return; } @@ -47,7 +48,7 @@ public class ModelArmor extends BipedModel { this.bipedHeadwear.copyModelAngles(this.bipedHead); } - protected void setRotateAngle(RendererModel modelRenderer, float x, float y, float z) { + protected void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) { modelRenderer.rotateAngleX = x; modelRenderer.rotateAngleY = y; modelRenderer.rotateAngleZ = z; diff --git a/src/main/java/vazkii/botania/client/model/armor/ModelArmorElementium.java b/src/main/java/vazkii/botania/client/model/armor/ModelArmorElementium.java index a1642b32e..38962bec0 100644 --- a/src/main/java/vazkii/botania/client/model/armor/ModelArmorElementium.java +++ b/src/main/java/vazkii/botania/client/model/armor/ModelArmorElementium.java @@ -10,7 +10,9 @@ */ package vazkii.botania.client.model.armor; -import net.minecraft.client.renderer.entity.model.RendererModel; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.vertex.IVertexBuilder; +import net.minecraft.client.renderer.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.inventory.EquipmentSlotType; @@ -19,41 +21,41 @@ import javax.annotation.Nonnull; public class ModelArmorElementium extends ModelArmor { - private final RendererModel helmAnchor; - private final RendererModel helm; - private final RendererModel helmFairy; - private final RendererModel helmWing1r; - private final RendererModel helmWing2l; - private final RendererModel helmWing1l; - private final RendererModel helmWing2r; + private final ModelRenderer helmAnchor; + private final ModelRenderer helm; + private final ModelRenderer helmFairy; + private final ModelRenderer helmWing1r; + private final ModelRenderer helmWing2l; + private final ModelRenderer helmWing1l; + private final ModelRenderer helmWing2r; - private final RendererModel bodyAnchor; - private final RendererModel bodyTop; - private final RendererModel bodyBottom; + private final ModelRenderer bodyAnchor; + private final ModelRenderer bodyTop; + private final ModelRenderer bodyBottom; - private final RendererModel armLAnchor; - private final RendererModel armL; - private final RendererModel armLpauldron; - private final RendererModel armLwing1; - private final RendererModel armLwing2; + private final ModelRenderer armLAnchor; + private final ModelRenderer armL; + private final ModelRenderer armLpauldron; + private final ModelRenderer armLwing1; + private final ModelRenderer armLwing2; - private final RendererModel armRAnchor; - private final RendererModel armR; - private final RendererModel armRpauldron; - private final RendererModel armRwing1; - private final RendererModel armRwing2; + private final ModelRenderer armRAnchor; + private final ModelRenderer armR; + private final ModelRenderer armRpauldron; + private final ModelRenderer armRwing1; + private final ModelRenderer armRwing2; - private final RendererModel pantsAnchor; - private final RendererModel belt; - private final RendererModel legL; - private final RendererModel legR; + private final ModelRenderer pantsAnchor; + private final ModelRenderer belt; + private final ModelRenderer legL; + private final ModelRenderer legR; - private final RendererModel bootL; - private final RendererModel bootLwing1; - private final RendererModel bootLwing2; - private final RendererModel bootR; - private final RendererModel bootRwing1; - private final RendererModel bootRwing2; + private final ModelRenderer bootL; + private final ModelRenderer bootLwing1; + private final ModelRenderer bootLwing2; + private final ModelRenderer bootR; + private final ModelRenderer bootRwing1; + private final ModelRenderer bootRwing2; public ModelArmorElementium(EquipmentSlotType slot) { super(slot); @@ -63,130 +65,130 @@ public class ModelArmorElementium extends ModelArmor { float s = 0.01F; //helm - this.helmAnchor = new RendererModel(this, 0, 0); + this.helmAnchor = new ModelRenderer(this, 0, 0); this.helmAnchor.setRotationPoint(0.0F, 0.0F, 0.0F); - this.helmAnchor.addBox(-1.0F, -2.0F, 0.0F, 2, 2, 2, s); - this.helm = new RendererModel(this, 0, 0); + this.helmAnchor.addCuboid(-1.0F, -2.0F, 0.0F, 2, 2, 2, s); + this.helm = new ModelRenderer(this, 0, 0); this.helm.setRotationPoint(0.0F, 0.0F, 0.0F); - this.helm.addBox(-4.5F, -9.0F, -4.5F, 9, 9, 9, s); - this.helmFairy = new RendererModel(this, 36, 11); + this.helm.addCuboid(-4.5F, -9.0F, -4.5F, 9, 9, 9, s); + this.helmFairy = new ModelRenderer(this, 36, 11); this.helmFairy.setRotationPoint(0.0F, 0.0F, 0.0F); - this.helmFairy.addBox(-2.5F, -10.0F, -5.5F, 5, 5, 5, s); - this.helmWing1l = new RendererModel(this, 36, 0); + this.helmFairy.addCuboid(-2.5F, -10.0F, -5.5F, 5, 5, 5, s); + this.helmWing1l = new ModelRenderer(this, 36, 0); this.helmWing1l.mirror = true; this.helmWing1l.setRotationPoint(4.5F, -6.0F, -0.5F); - this.helmWing1l.addBox(-1.0F, -5.0F, 0.0F, 1, 5, 6, s); + this.helmWing1l.addCuboid(-1.0F, -5.0F, 0.0F, 1, 5, 6, s); this.setRotateAngle(helmWing1l, 0.2617993877991494F, 0.5235987755982988F, 0.2617993877991494F); - this.helmWing2l = new RendererModel(this, 50, 0); + this.helmWing2l = new ModelRenderer(this, 50, 0); this.helmWing2l.setRotationPoint(4.5F, -6.0F, -0.5F); - this.helmWing2l.addBox(-1.0F, 0.0F, 0.0F, 1, 3, 4, s); + this.helmWing2l.addCuboid(-1.0F, 0.0F, 0.0F, 1, 3, 4, s); this.setRotateAngle(helmWing2l, -0.2617993877991494F, 0.2617993877991494F, -0.2617993877991494F); - this.helmWing1r = new RendererModel(this, 36, 0); + this.helmWing1r = new ModelRenderer(this, 36, 0); this.helmWing1r.setRotationPoint(-4.5F, -6.0F, -0.5F); - this.helmWing1r.addBox(0.0F, -5.0F, 0.0F, 1, 5, 6, s); + this.helmWing1r.addCuboid(0.0F, -5.0F, 0.0F, 1, 5, 6, s); this.setRotateAngle(helmWing1r, 0.2617993877991494F, -0.5235987755982988F, -0.2617993877991494F); - this.helmWing2r = new RendererModel(this, 50, 0); + this.helmWing2r = new ModelRenderer(this, 50, 0); this.helmWing2r.mirror = true; this.helmWing2r.setRotationPoint(-4.5F, -6.0F, -0.5F); - this.helmWing2r.addBox(0.0F, 0.0F, 0.0F, 1, 3, 4, s); + this.helmWing2r.addCuboid(0.0F, 0.0F, 0.0F, 1, 3, 4, s); this.setRotateAngle(helmWing2r, -0.2617993877991494F, -0.2617993877991494F, 0.2617993877991494F); //body - this.bodyAnchor = new RendererModel(this, 0, 0); + this.bodyAnchor = new ModelRenderer(this, 0, 0); this.bodyAnchor.setRotationPoint(0.0F, 0.0F, 0.0F); - this.bodyAnchor.addBox(-1.0F, 0.0F, -1.0F, 2, 2, 2, s); - this.bodyTop = new RendererModel(this, 0, 19); + this.bodyAnchor.addCuboid(-1.0F, 0.0F, -1.0F, 2, 2, 2, s); + this.bodyTop = new ModelRenderer(this, 0, 19); this.bodyTop.setRotationPoint(0.0F, 0.0F, 0.0F); - this.bodyTop.addBox(-4.5F, 0.0F, -3.0F, 9, 6, 6, s); - this.bodyBottom = new RendererModel(this, 0, 31); + this.bodyTop.addCuboid(-4.5F, 0.0F, -3.0F, 9, 6, 6, s); + this.bodyBottom = new ModelRenderer(this, 0, 31); this.bodyBottom.setRotationPoint(0.0F, 0.0F, 0.0F); - this.bodyBottom.addBox(-3.5F, 5.0F, -2.5F, 7, 3, 5, s); + this.bodyBottom.addCuboid(-3.5F, 5.0F, -2.5F, 7, 3, 5, s); //armL - this.armLAnchor = new RendererModel(this, 0, 0); + this.armLAnchor = new ModelRenderer(this, 0, 0); this.armLAnchor.mirror = true; this.armLAnchor.setRotationPoint(4.0F, 2.0F, 0.0F); - this.armLAnchor.addBox(0.0F, -1.0F, -1.0F, 2, 2, 2, s); - this.armL = new RendererModel(this, 24, 40); + this.armLAnchor.addCuboid(0.0F, -1.0F, -1.0F, 2, 2, 2, s); + this.armL = new ModelRenderer(this, 24, 40); this.armL.mirror = true; this.armL.setRotationPoint(0.0F, 0.0F, -0.0F); - this.armL.addBox(0.5F, 4.5F, -2.49F, 3, 6, 5, s); - this.armLpauldron = new RendererModel(this, 0, 40); + this.armL.addCuboid(0.5F, 4.5F, -2.49F, 3, 6, 5, s); + this.armLpauldron = new ModelRenderer(this, 0, 40); this.armLpauldron.mirror = true; this.armLpauldron.setRotationPoint(0.0F, 0.0F, 0.0F); - this.armLpauldron.addBox(-0.5F, -3.0F, -3.0F, 6, 7, 6, s); - this.armLwing1 = new RendererModel(this, 40, 35); + this.armLpauldron.addCuboid(-0.5F, -3.0F, -3.0F, 6, 7, 6, s); + this.armLwing1 = new ModelRenderer(this, 40, 35); this.armLwing1.setRotationPoint(6.0F, -1.0F, 0.0F); - this.armLwing1.addBox(0.0F, -4.0F, 0.0F, 0, 4, 5, s); + this.armLwing1.addCuboid(0.0F, -4.0F, 0.0F, 0, 4, 5, s); this.setRotateAngle(armLwing1, 0.2617993877991494F, 0.5235987755982988F, 0.2617993877991494F); - this.armLwing2 = new RendererModel(this, 40, 40); + this.armLwing2 = new ModelRenderer(this, 40, 40); this.armLwing2.setRotationPoint(6.0F, -1.0F, 0.0F); - this.armLwing2.addBox(0.0F, 0.0F, 0.0F, 0, 3, 4, s); + this.armLwing2.addCuboid(0.0F, 0.0F, 0.0F, 0, 3, 4, s); this.setRotateAngle(armLwing2, -0.2617993877991494F, 0.2617993877991494F, -0.2617993877991494F); //armR - this.armRAnchor = new RendererModel(this, 0, 0); + this.armRAnchor = new ModelRenderer(this, 0, 0); this.armRAnchor.mirror = true; this.armRAnchor.setRotationPoint(-4.0F, 2.0F, 0.0F); - this.armRAnchor.addBox(-2.0F, -1.0F, -1.0F, 2, 2, 2, s); - this.armR = new RendererModel(this, 24, 40); + this.armRAnchor.addCuboid(-2.0F, -1.0F, -1.0F, 2, 2, 2, s); + this.armR = new ModelRenderer(this, 24, 40); this.armR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.armR.addBox(-3.5F, 4.5F, -2.51F, 3, 6, 5, s); - this.armRpauldron = new RendererModel(this, 0, 40); + this.armR.addCuboid(-3.5F, 4.5F, -2.51F, 3, 6, 5, s); + this.armRpauldron = new ModelRenderer(this, 0, 40); this.armRpauldron.setRotationPoint(0.0F, 0.0F, 0.0F); - this.armRpauldron.addBox(-5.5F, -3.0F, -3.0F, 6, 7, 6, s); + this.armRpauldron.addCuboid(-5.5F, -3.0F, -3.0F, 6, 7, 6, s); this.setRotateAngle(armRpauldron, 0.0F, 0.0F, 0.0017453292519943296F); - this.armRwing1 = new RendererModel(this, 40, 35); + this.armRwing1 = new ModelRenderer(this, 40, 35); this.armRwing1.mirror = true; this.armRwing1.setRotationPoint(-6.5F, -1.0F, 0.0F); - this.armRwing1.addBox(0.0F, -4.0F, 0.0F, 0, 4, 5, s); + this.armRwing1.addCuboid(0.0F, -4.0F, 0.0F, 0, 4, 5, s); this.setRotateAngle(armRwing1, 0.2617993877991494F, -0.5235987755982988F, -0.2617993877991494F); - this.armRwing2 = new RendererModel(this, 40, 40); + this.armRwing2 = new ModelRenderer(this, 40, 40); this.armRwing2.mirror = true; this.armRwing2.setRotationPoint(-6.5F, -1.0F, 0.0F); - this.armRwing2.addBox(0.0F, 0.0F, 0.0F, 0, 3, 4, s); + this.armRwing2.addCuboid(0.0F, 0.0F, 0.0F, 0, 3, 4, s); this.setRotateAngle(armRwing2, -0.2617993877991494F, -0.2617993877991494F, 0.2617993877991494F); //pants - this.pantsAnchor = new RendererModel(this, 0, 0); + this.pantsAnchor = new ModelRenderer(this, 0, 0); this.pantsAnchor.setRotationPoint(0.0F, 0.0F, 0.0F); - this.pantsAnchor.addBox(-1.0F, 0.0F, -1.0F, 2, 2, 2, s); - this.belt = new RendererModel(this, 0, 53); + this.pantsAnchor.addCuboid(-1.0F, 0.0F, -1.0F, 2, 2, 2, s); + this.belt = new ModelRenderer(this, 0, 53); this.belt.setRotationPoint(0.0F, 0.0F, 0.0F); - this.belt.addBox(-4.5F, 8.0F, -3.0F, 9, 5, 6, s); - this.legL = new RendererModel(this, 0, 64); + this.belt.addCuboid(-4.5F, 8.0F, -3.0F, 9, 5, 6, s); + this.legL = new ModelRenderer(this, 0, 64); this.legL.mirror = true; this.legL.setRotationPoint(1.9F, 12.0F, 0.0F); - this.legL.addBox(-2.39F, 0.0F, -2.49F, 5, 6, 5, s); - this.legR = new RendererModel(this, 0, 64); + this.legL.addCuboid(-2.39F, 0.0F, -2.49F, 5, 6, 5, s); + this.legR = new ModelRenderer(this, 0, 64); this.legR.setRotationPoint(-1.9F, 12.0F, 0.0F); - this.legR.addBox(-2.61F, 0.0F, -2.51F, 5, 6, 5, s); + this.legR.addCuboid(-2.61F, 0.0F, -2.51F, 5, 6, 5, s); //boots - this.bootL = new RendererModel(this, 0, 75); + this.bootL = new ModelRenderer(this, 0, 75); this.bootL.mirror = true; this.bootL.setRotationPoint(1.9F, 12.0F, 0.0F); - this.bootL.addBox(-2.39F, 8.5F, -2.49F, 5, 5, 5, s); - this.bootLwing1 = new RendererModel(this, 40, 40); + this.bootL.addCuboid(-2.39F, 8.5F, -2.49F, 5, 5, 5, s); + this.bootLwing1 = new ModelRenderer(this, 40, 40); this.bootLwing1.setRotationPoint(2.5F, 8.5F, 0.0F); - this.bootLwing1.addBox(0.0F, -3.0F, 0.0F, 0, 3, 4, s); + this.bootLwing1.addCuboid(0.0F, -3.0F, 0.0F, 0, 3, 4, s); this.setRotateAngle(bootLwing1, 0.2617993877991494F, 0.5235987755982988F, 0.2617993877991494F); - this.bootLwing2 = new RendererModel(this, 40, 44); + this.bootLwing2 = new ModelRenderer(this, 40, 44); this.bootLwing2.setRotationPoint(2.5F, 8.5F, 0.0F); - this.bootLwing2.addBox(0.0F, 0.0F, 0.0F, 0, 2, 3, s); + this.bootLwing2.addCuboid(0.0F, 0.0F, 0.0F, 0, 2, 3, s); this.setRotateAngle(bootLwing2, -0.2617993877991494F, 0.2617993877991494F, -0.2617993877991494F); - this.bootR = new RendererModel(this, 0, 75); + this.bootR = new ModelRenderer(this, 0, 75); this.bootR.setRotationPoint(-1.9F, 12.0F, 0.0F); - this.bootR.addBox(-2.61F, 8.5F, -2.51F, 5, 5, 5, s); - this.bootRwing1 = new RendererModel(this, 40, 40); + this.bootR.addCuboid(-2.61F, 8.5F, -2.51F, 5, 5, 5, s); + this.bootRwing1 = new ModelRenderer(this, 40, 40); this.bootRwing1.mirror = true; this.bootRwing1.setRotationPoint(-2.6F, 8.5F, 0.0F); - this.bootRwing1.addBox(0.0F, -3.0F, 0.0F, 0, 3, 4, s); + this.bootRwing1.addCuboid(0.0F, -3.0F, 0.0F, 0, 3, 4, s); this.setRotateAngle(bootRwing1, 0.2617993877991494F, -0.5235987755982988F, -0.2617993877991494F); - this.bootRwing2 = new RendererModel(this, 40, 44); + this.bootRwing2 = new ModelRenderer(this, 40, 44); this.bootRwing2.mirror = true; this.bootRwing2.setRotationPoint(-2.5F, 8.5F, 0.0F); - this.bootRwing2.addBox(0.0F, 0.0F, 0.0F, 0, 2, 3, s); + this.bootRwing2.addCuboid(0.0F, 0.0F, 0.0F, 0, 2, 3, s); this.setRotateAngle(bootRwing2, -0.2617993877991494F, -0.2617993877991494F, 0.2617993877991494F); //hierarchy diff --git a/src/main/java/vazkii/botania/client/model/armor/ModelArmorManasteel.java b/src/main/java/vazkii/botania/client/model/armor/ModelArmorManasteel.java index cb03ad8f3..fe9c97342 100644 --- a/src/main/java/vazkii/botania/client/model/armor/ModelArmorManasteel.java +++ b/src/main/java/vazkii/botania/client/model/armor/ModelArmorManasteel.java @@ -10,7 +10,9 @@ */ package vazkii.botania.client.model.armor; -import net.minecraft.client.renderer.entity.model.RendererModel; +import com.mojang.blaze3d.matrix.MatrixStack; +import com.mojang.blaze3d.vertex.IVertexBuilder; +import net.minecraft.client.renderer.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.inventory.EquipmentSlotType; @@ -19,33 +21,33 @@ import javax.annotation.Nonnull; public class ModelArmorManasteel extends ModelArmor { - private final RendererModel helmAnchor; - private final RendererModel helm; - private final RendererModel helmTop; - private final RendererModel helmCrystal; + private final ModelRenderer helmAnchor; + private final ModelRenderer helm; + private final ModelRenderer helmTop; + private final ModelRenderer helmCrystal; - private final RendererModel bodyAnchor; - private final RendererModel bodyTop; - private final RendererModel bodyBottom; + private final ModelRenderer bodyAnchor; + private final ModelRenderer bodyTop; + private final ModelRenderer bodyBottom; - private final RendererModel armLAnchor; - private final RendererModel armL; - private final RendererModel armLpauldron; - private final RendererModel armLcrystal; + private final ModelRenderer armLAnchor; + private final ModelRenderer armL; + private final ModelRenderer armLpauldron; + private final ModelRenderer armLcrystal; - private final RendererModel armRAnchor; - private final RendererModel armR; - private final RendererModel armRpauldron; - private final RendererModel armRcrystal; - private final RendererModel pantsAnchor; - private final RendererModel belt; - private final RendererModel legL; - private final RendererModel legR; + private final ModelRenderer armRAnchor; + private final ModelRenderer armR; + private final ModelRenderer armRpauldron; + private final ModelRenderer armRcrystal; + private final ModelRenderer pantsAnchor; + private final ModelRenderer belt; + private final ModelRenderer legL; + private final ModelRenderer legR; - private final RendererModel bootL; - private final RendererModel bootLcrystal; - private final RendererModel bootR; - private final RendererModel bootRcrystal; + private final ModelRenderer bootL; + private final ModelRenderer bootLcrystal; + private final ModelRenderer bootR; + private final ModelRenderer bootRcrystal; public ModelArmorManasteel(EquipmentSlotType slot) { super(slot); @@ -55,99 +57,99 @@ public class ModelArmorManasteel extends ModelArmor { float s = 0.01F; //helm - this.helmAnchor = new RendererModel(this, 0, 0); + this.helmAnchor = new ModelRenderer(this, 0, 0); this.helmAnchor.setRotationPoint(0.0F, 0.0F, 0.0F); - this.helmAnchor.addBox(-1.0F, -2.0F, 0.0F, 2, 2, 2, s); - this.helm = new RendererModel(this, 0, 0); + this.helmAnchor.addCuboid(-1.0F, -2.0F, 0.0F, 2, 2, 2, s); + this.helm = new ModelRenderer(this, 0, 0); this.helm.setRotationPoint(0.0F, 0.0F, 0.0F); - this.helm.addBox(-4.5F, -8.5F, -4.5F, 9, 9, 9, s); - this.helmTop = new RendererModel(this, 36, 6); + this.helm.addCuboid(-4.5F, -8.5F, -4.5F, 9, 9, 9, s); + this.helmTop = new ModelRenderer(this, 36, 6); this.helmTop.setRotationPoint(0.0F, -8.5F, 3.5F); - this.helmTop.addBox(-1.5F, 0.0F, -7.0F, 3, 3, 7, s); + this.helmTop.addCuboid(-1.5F, 0.0F, -7.0F, 3, 3, 7, s); this.setRotateAngle(helmTop, -0.2617993877991494F, 0.0F, 0.0F); - this.helmCrystal = new RendererModel(this, 36, 0); + this.helmCrystal = new ModelRenderer(this, 36, 0); this.helmCrystal.setRotationPoint(0.0F, -7.5F, -4.5F); - this.helmCrystal.addBox(-1.5F, -4.0F, -1.0F, 3, 5, 1, s); + this.helmCrystal.addCuboid(-1.5F, -4.0F, -1.0F, 3, 5, 1, s); this.setRotateAngle(helmCrystal, 0.08726646259971647F, 0.0F, 0.0F); //body - this.bodyAnchor = new RendererModel(this, 0, 0); + this.bodyAnchor = new ModelRenderer(this, 0, 0); this.bodyAnchor.setRotationPoint(0.0F, 0.0F, 0.0F); - this.bodyAnchor.addBox(-1.0F, 0.0F, -1.0F, 2, 2, 2, s); - this.bodyTop = new RendererModel(this, 0, 18); + this.bodyAnchor.addCuboid(-1.0F, 0.0F, -1.0F, 2, 2, 2, s); + this.bodyTop = new ModelRenderer(this, 0, 18); this.bodyTop.setRotationPoint(0.0F, 0.0F, 0.0F); - this.bodyTop.addBox(-4.5F, -0.5F, -3.0F, 9, 6, 6, s); + this.bodyTop.addCuboid(-4.5F, -0.5F, -3.0F, 9, 6, 6, s); this.setRotateAngle(bodyTop, 0.0F, 0.0F, 0.0F); - this.bodyBottom = new RendererModel(this, 0, 30); + this.bodyBottom = new ModelRenderer(this, 0, 30); this.bodyBottom.setRotationPoint(0.0F, 0.0F, 0.0F); - this.bodyBottom.addBox(-2.5F, 5.5F, -2.5F, 5, 3, 5, 0.0F); + this.bodyBottom.addCuboid(-2.5F, 5.5F, -2.5F, 5, 3, 5, 0.0F); //armL - this.armLAnchor = new RendererModel(this, 0, 0); + this.armLAnchor = new ModelRenderer(this, 0, 0); this.armLAnchor.mirror = true; this.armLAnchor.setRotationPoint(4.0F, 2.0F, 0.0F); - this.armLAnchor.addBox(0.0F, -1.0F, -1.0F, 2, 2, 2, s); - this.armL = new RendererModel(this, 22, 40); + this.armLAnchor.addCuboid(0.0F, -1.0F, -1.0F, 2, 2, 2, s); + this.armL = new ModelRenderer(this, 22, 40); this.armL.mirror = true; this.armL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.armL.addBox(1.5F, 2.0F, -2.49F, 2, 6, 5, s); - this.armLpauldron = new RendererModel(this, 0, 40); + this.armL.addCuboid(1.5F, 2.0F, -2.49F, 2, 6, 5, s); + this.armLpauldron = new ModelRenderer(this, 0, 40); this.armLpauldron.mirror = true; this.armLpauldron.setRotationPoint(0.0F, 0.0F, 0.0F); - this.armLpauldron.addBox(-0.5F, -3.0F, -3.0F, 5, 4, 6, s); - this.armLcrystal = new RendererModel(this, 36, 40); + this.armLpauldron.addCuboid(-0.5F, -3.0F, -3.0F, 5, 4, 6, s); + this.armLcrystal = new ModelRenderer(this, 36, 40); this.armLcrystal.mirror = true; this.armLcrystal.setRotationPoint(2.0F, -2.5F, 0.0F); - this.armLcrystal.addBox(-0.5F, -2.5F, -1.5F, 2, 3, 3, s); + this.armLcrystal.addCuboid(-0.5F, -2.5F, -1.5F, 2, 3, 3, s); this.setRotateAngle(armLcrystal, 0.0F, 0.0F, -0.08726646259971647F); //armR - this.armRAnchor = new RendererModel(this, 0, 0); + this.armRAnchor = new ModelRenderer(this, 0, 0); this.armRAnchor.mirror = true; this.armRAnchor.setRotationPoint(-4.0F, 2.0F, 0.0F); - this.armRAnchor.addBox(-2.0F, -1.0F, -1.0F, 2, 2, 2, s); - this.armR = new RendererModel(this, 22, 40); + this.armRAnchor.addCuboid(-2.0F, -1.0F, -1.0F, 2, 2, 2, s); + this.armR = new ModelRenderer(this, 22, 40); this.armR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.armR.addBox(-3.5F, 2.0F, -2.51F, 2, 6, 5, s); - this.armRpauldron = new RendererModel(this, 0, 40); + this.armR.addCuboid(-3.5F, 2.0F, -2.51F, 2, 6, 5, s); + this.armRpauldron = new ModelRenderer(this, 0, 40); this.armRpauldron.setRotationPoint(0.0F, 0.0F, 0.0F); - this.armRpauldron.addBox(-4.5F, -3.0F, -3.0F, 5, 4, 6, s); - this.armRcrystal = new RendererModel(this, 36, 40); + this.armRpauldron.addCuboid(-4.5F, -3.0F, -3.0F, 5, 4, 6, s); + this.armRcrystal = new ModelRenderer(this, 36, 40); this.armRcrystal.setRotationPoint(-2.0F, -2.5F, 0.0F); - this.armRcrystal.addBox(-1.5F, -2.5F, -1.5F, 2, 3, 3, s); + this.armRcrystal.addCuboid(-1.5F, -2.5F, -1.5F, 2, 3, 3, s); this.setRotateAngle(armRcrystal, 0.0F, 0.0F, 0.08726646259971647F); //pants - this.pantsAnchor = new RendererModel(this, 0, 0); + this.pantsAnchor = new ModelRenderer(this, 0, 0); this.pantsAnchor.setRotationPoint(0.0F, 0.0F, 0.0F); - this.pantsAnchor.addBox(-1.0F, 0.0F, -1.0F, 2, 2, 2, s); - this.belt = new RendererModel(this, 0, 51); + this.pantsAnchor.addCuboid(-1.0F, 0.0F, -1.0F, 2, 2, 2, s); + this.belt = new ModelRenderer(this, 0, 51); this.belt.setRotationPoint(0.0F, 0.0F, 0.0F); - this.belt.addBox(-4.5F, 9.0F, -3.0F, 9, 3, 6, s); - this.legL = new RendererModel(this, 0, 60); + this.belt.addCuboid(-4.5F, 9.0F, -3.0F, 9, 3, 6, s); + this.legL = new ModelRenderer(this, 0, 60); this.legL.mirror = true; this.legL.setRotationPoint(1.9F, 12.0F, 0.0F); - this.legL.addBox(-0.39F, 0.0F, -2.49F, 3, 6, 5, s); - this.legR = new RendererModel(this, 0, 60); + this.legL.addCuboid(-0.39F, 0.0F, -2.49F, 3, 6, 5, s); + this.legR = new ModelRenderer(this, 0, 60); this.legR.setRotationPoint(-1.9F, 12.0F, 0.0F); - this.legR.addBox(-2.61F, 0.0F, -2.51F, 3, 6, 5, s); + this.legR.addCuboid(-2.61F, 0.0F, -2.51F, 3, 6, 5, s); //boots - this.bootL = new RendererModel(this, 0, 71); + this.bootL = new ModelRenderer(this, 0, 71); this.bootL.mirror = true; this.bootL.setRotationPoint(1.9F, 12.0F, 0.0F); - this.bootL.addBox(-2.39F, 8.5F, -2.49F, 5, 4, 5, s); - this.bootLcrystal = new RendererModel(this, 36, 46); + this.bootL.addCuboid(-2.39F, 8.5F, -2.49F, 5, 4, 5, s); + this.bootLcrystal = new ModelRenderer(this, 36, 46); this.bootLcrystal.mirror = true; this.bootLcrystal.setRotationPoint(2.5F, 9.0F, 2.0F); - this.bootLcrystal.addBox(-1.0F, -2.0F, -1.5F, 2, 3, 3, s); + this.bootLcrystal.addCuboid(-1.0F, -2.0F, -1.5F, 2, 3, 3, s); this.setRotateAngle(bootLcrystal, 0.0F, 0.0F, 0.08726646259971647F); - this.bootR = new RendererModel(this, 0, 71); + this.bootR = new ModelRenderer(this, 0, 71); this.bootR.setRotationPoint(-2.0F, 12.0F, 0.0F); - this.bootR.addBox(-2.5F, 8.5F, -2.51F, 5, 4, 5, s); - this.bootRcrystal = new RendererModel(this, 36, 46); + this.bootR.addCuboid(-2.5F, 8.5F, -2.51F, 5, 4, 5, s); + this.bootRcrystal = new ModelRenderer(this, 36, 46); this.bootRcrystal.setRotationPoint(-2.5F, 9.0F, 2.0F); - this.bootRcrystal.addBox(-1.0F, -2.0F, -1.5F, 2, 3, 3, s); + this.bootRcrystal.addCuboid(-1.0F, -2.0F, -1.5F, 2, 3, 3, s); this.setRotateAngle(bootRcrystal, 0.0F, 0.0F, -0.08726646259971647F); //hierarchy @@ -173,7 +175,7 @@ public class ModelArmorManasteel extends ModelArmor { } @Override - public void render(@Nonnull LivingEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) { + public void render(@Nonnull LivingEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { helmAnchor.showModel = slot == EquipmentSlotType.HEAD; bodyAnchor.showModel = slot == EquipmentSlotType.CHEST; @@ -198,6 +200,6 @@ public class ModelArmorManasteel extends ModelArmor { bipedLeftLeg = bootL; } - super.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale); + super.render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch); } } \ No newline at end of file diff --git a/src/main/java/vazkii/botania/client/model/armor/ModelArmorManaweave.java b/src/main/java/vazkii/botania/client/model/armor/ModelArmorManaweave.java index 55b7efdac..b407954f9 100644 --- a/src/main/java/vazkii/botania/client/model/armor/ModelArmorManaweave.java +++ b/src/main/java/vazkii/botania/client/model/armor/ModelArmorManaweave.java @@ -10,8 +10,7 @@ */ package vazkii.botania.client.model.armor; -import net.minecraft.client.renderer.entity.model.RendererModel; -import net.minecraft.entity.Entity; +import net.minecraft.client.renderer.model.ModelRenderer; import net.minecraft.entity.LivingEntity; import net.minecraft.inventory.EquipmentSlotType; @@ -19,28 +18,28 @@ import javax.annotation.Nonnull; public class ModelArmorManaweave extends ModelArmor { - private final RendererModel helmAnchor; - private final RendererModel helm; + private final ModelRenderer helmAnchor; + private final ModelRenderer helm; - private final RendererModel bodyAnchor; - private final RendererModel bodyTop; - private final RendererModel bodyBottom; + private final ModelRenderer bodyAnchor; + private final ModelRenderer bodyTop; + private final ModelRenderer bodyBottom; - private final RendererModel armLAnchor; - private final RendererModel armL; - private final RendererModel armLpauldron; - private final RendererModel armRAnchor; - private final RendererModel armR; - private final RendererModel armRpauldron; + private final ModelRenderer armLAnchor; + private final ModelRenderer armL; + private final ModelRenderer armLpauldron; + private final ModelRenderer armRAnchor; + private final ModelRenderer armR; + private final ModelRenderer armRpauldron; - private final RendererModel pantsAnchor; - private final RendererModel legL; - private final RendererModel skirtL; - private final RendererModel legR; - private final RendererModel skirtR; + private final ModelRenderer pantsAnchor; + private final ModelRenderer legL; + private final ModelRenderer skirtL; + private final ModelRenderer legR; + private final ModelRenderer skirtR; - private final RendererModel bootL; - private final RendererModel bootR; + private final ModelRenderer bootL; + private final ModelRenderer bootR; public ModelArmorManaweave(EquipmentSlotType slot) { super(slot); @@ -50,84 +49,84 @@ public class ModelArmorManaweave extends ModelArmor { float s = 0.01F; //helm - this.helmAnchor = new RendererModel(this, 0, 0); + this.helmAnchor = new ModelRenderer(this, 0, 0); this.helmAnchor.setRotationPoint(0.0F, 0.0F, 0.0F); - this.helmAnchor.addBox(-1.0F, -2.0F, 0.0F, 2, 2, 2, s); - this.helm = new RendererModel(this, 0, 0); + this.helmAnchor.addCuboid(-1.0F, -2.0F, 0.0F, 2, 2, 2, s); + this.helm = new ModelRenderer(this, 0, 0); this.helm.setRotationPoint(0.0F, 0.0F, 0.0F); - this.helm.addBox(-4.5F, -9.5F, -4.0F, 9, 11, 10, s); + this.helm.addCuboid(-4.5F, -9.5F, -4.0F, 9, 11, 10, s); this.setRotateAngle(helm, 0.17453292519943295F, 0.0F, 0.0F); //body - this.bodyAnchor = new RendererModel(this, 0, 0); + this.bodyAnchor = new ModelRenderer(this, 0, 0); this.bodyAnchor.setRotationPoint(0.0F, 0.0F, 0.0F); - this.bodyAnchor.addBox(-1.0F, 0.0F, -1.0F, 2, 2, 2, s); - this.bodyTop = new RendererModel(this, 0, 21); + this.bodyAnchor.addCuboid(-1.0F, 0.0F, -1.0F, 2, 2, 2, s); + this.bodyTop = new ModelRenderer(this, 0, 21); this.bodyTop.setRotationPoint(0.0F, 0.0F, 0.0F); - this.bodyTop.addBox(-4.5F, -0.5F, -3.0F, 9, 7, 6, s); + this.bodyTop.addCuboid(-4.5F, -0.5F, -3.0F, 9, 7, 6, s); this.setRotateAngle(bodyTop, 0.0F, 0.0F, 0.0F); - this.bodyBottom = new RendererModel(this, 0, 34); + this.bodyBottom = new ModelRenderer(this, 0, 34); this.bodyBottom.setRotationPoint(0.0F, 0.0F, 0.0F); - this.bodyBottom.addBox(-4.5F, 6.5F, -2.5F, 9, 5, 5, s); + this.bodyBottom.addCuboid(-4.5F, 6.5F, -2.5F, 9, 5, 5, s); this.setRotateAngle(bodyBottom, -0F, 0.0F, 0.0F); //armL - this.armLAnchor = new RendererModel(this, 0, 0); + this.armLAnchor = new ModelRenderer(this, 0, 0); this.armLAnchor.mirror = true; this.armLAnchor.setRotationPoint(4.0F, 2.0F, 0.0F); - this.armLAnchor.addBox(0.0F, -1.0F, -1.0F, 2, 2, 2, s); - this.armL = new RendererModel(this, 0, 44); + this.armLAnchor.addCuboid(0.0F, -1.0F, -1.0F, 2, 2, 2, s); + this.armL = new ModelRenderer(this, 0, 44); this.armL.mirror = true; this.armL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.armL.addBox(-1.5F, -2.5F, -2.49F, 5, 10, 5, s); - this.armLpauldron = new RendererModel(this, 20, 44); + this.armL.addCuboid(-1.5F, -2.5F, -2.49F, 5, 10, 5, s); + this.armLpauldron = new ModelRenderer(this, 20, 44); this.armLpauldron.mirror = true; this.armLpauldron.setRotationPoint(0.0F, 0.0F, 0.0F); - this.armLpauldron.addBox(-1.0F, -3.0F, -3.0F, 6, 5, 6, s); + this.armLpauldron.addCuboid(-1.0F, -3.0F, -3.0F, 6, 5, 6, s); this.setRotateAngle(armLpauldron, 0.0F, 0.0F, -0.08726646259971647F); //armR - this.armRAnchor = new RendererModel(this, 0, 0); + this.armRAnchor = new ModelRenderer(this, 0, 0); this.armRAnchor.mirror = true; this.armRAnchor.setRotationPoint(-4.0F, 2.0F, 0.0F); - this.armRAnchor.addBox(-2.0F, -1.0F, -1.0F, 2, 2, 2, s); - this.armR = new RendererModel(this, 0, 44); + this.armRAnchor.addCuboid(-2.0F, -1.0F, -1.0F, 2, 2, 2, s); + this.armR = new ModelRenderer(this, 0, 44); this.armR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.armR.addBox(-3.5F, -2.5F, -2.51F, 5, 10, 5, s); - this.armRpauldron = new RendererModel(this, 20, 44); + this.armR.addCuboid(-3.5F, -2.5F, -2.51F, 5, 10, 5, s); + this.armRpauldron = new ModelRenderer(this, 20, 44); this.armRpauldron.setRotationPoint(0.0F, 0.0F, 0.0F); - this.armRpauldron.addBox(-5.0F, -3.0F, -3.0F, 6, 5, 6, s); + this.armRpauldron.addCuboid(-5.0F, -3.0F, -3.0F, 6, 5, 6, s); this.setRotateAngle(armRpauldron, 0.0F, 0.0F, 0.08726646259971647F); //pants - this.pantsAnchor = new RendererModel(this, 0, 0); + this.pantsAnchor = new ModelRenderer(this, 0, 0); this.pantsAnchor.setRotationPoint(0.0F, 0.0F, 0.0F); - this.pantsAnchor.addBox(-1.0F, 0.0F, -1.0F, 2, 2, 2, s); - this.legL = new RendererModel(this, 0, 78); + this.pantsAnchor.addCuboid(-1.0F, 0.0F, -1.0F, 2, 2, 2, s); + this.legL = new ModelRenderer(this, 0, 78); this.legL.mirror = true; this.legL.setRotationPoint(1.9F, 12.0F, 0.0F); - this.legL.addBox(-2.39F, -0.5F, -2.49F, 5, 6, 5, s); - this.skirtL = new RendererModel(this, 0, 59); + this.legL.addCuboid(-2.39F, -0.5F, -2.49F, 5, 6, 5, s); + this.skirtL = new ModelRenderer(this, 0, 59); this.skirtL.mirror = true; this.skirtL.setRotationPoint(-0.5F, -2.0F, -2.5F); - this.skirtL.addBox(-1.0F, 0.0F, -0.5F, 5, 13, 6, s); + this.skirtL.addCuboid(-1.0F, 0.0F, -0.5F, 5, 13, 6, s); this.setRotateAngle(skirtL, 0.0F, -0.17453292519943295F, -0.2617993877991494F); - this.legR = new RendererModel(this, 0, 78); + this.legR = new ModelRenderer(this, 0, 78); this.legR.setRotationPoint(-1.9F, 12.0F, 0.0F); - this.legR.addBox(-2.61F, 0.0F, -2.51F, 5, 6, 5, s); - this.skirtR = new RendererModel(this, 0, 59); + this.legR.addCuboid(-2.61F, 0.0F, -2.51F, 5, 6, 5, s); + this.skirtR = new ModelRenderer(this, 0, 59); this.skirtR.setRotationPoint(0.5F, -2.0F, -2.5F); - this.skirtR.addBox(-4.0F, 0.0F, -0.5F, 5, 13, 6, s); + this.skirtR.addCuboid(-4.0F, 0.0F, -0.5F, 5, 13, 6, s); this.setRotateAngle(skirtR, 0.0F, 0.17453292519943295F, 0.2617993877991494F); //boot - this.bootL = new RendererModel(this, 0, 89); + this.bootL = new ModelRenderer(this, 0, 89); this.bootL.mirror = true; this.bootL.setRotationPoint(1.9F, 12.0F, 0.0F); - this.bootL.addBox(-2.39F, 8.5F, -2.49F, 5, 4, 5, s); - this.bootR = new RendererModel(this, 0, 89); + this.bootL.addCuboid(-2.39F, 8.5F, -2.49F, 5, 4, 5, s); + this.bootR = new ModelRenderer(this, 0, 89); this.bootR.setRotationPoint(-1.9F, 12.0F, 0.0F); - this.bootR.addBox(-2.61F, 8.5F, -2.51F, 5, 4, 5, s); + this.bootR.addCuboid(-2.61F, 8.5F, -2.51F, 5, 4, 5, s); //hierarchy this.helmAnchor.addChild(this.helm); diff --git a/src/main/java/vazkii/botania/client/model/armor/ModelArmorTerrasteel.java b/src/main/java/vazkii/botania/client/model/armor/ModelArmorTerrasteel.java index 70a02ac27..8369d658e 100644 --- a/src/main/java/vazkii/botania/client/model/armor/ModelArmorTerrasteel.java +++ b/src/main/java/vazkii/botania/client/model/armor/ModelArmorTerrasteel.java @@ -10,7 +10,7 @@ */ package vazkii.botania.client.model.armor; -import net.minecraft.client.renderer.entity.model.RendererModel; +import net.minecraft.client.renderer.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.inventory.EquipmentSlotType; @@ -19,50 +19,50 @@ import javax.annotation.Nonnull; public class ModelArmorTerrasteel extends ModelArmor { - private final RendererModel helmAnchor; - private final RendererModel helm; - private final RendererModel helmFront; - private final RendererModel helmLeaf1l; - private final RendererModel helmLeaf2l; - private final RendererModel helmLeaf3l; - private final RendererModel helmLeaf1r; - private final RendererModel helmLeaf2r; - private final RendererModel helmLeaf3r; - private final RendererModel helmbranch1l; - private final RendererModel helmbranch2l; - private final RendererModel helmbranch1r; - private final RendererModel helmbranch2r; + private final ModelRenderer helmAnchor; + private final ModelRenderer helm; + private final ModelRenderer helmFront; + private final ModelRenderer helmLeaf1l; + private final ModelRenderer helmLeaf2l; + private final ModelRenderer helmLeaf3l; + private final ModelRenderer helmLeaf1r; + private final ModelRenderer helmLeaf2r; + private final ModelRenderer helmLeaf3r; + private final ModelRenderer helmbranch1l; + private final ModelRenderer helmbranch2l; + private final ModelRenderer helmbranch1r; + private final ModelRenderer helmbranch2r; - private final RendererModel bodyAnchor; - private final RendererModel bodyTop; - private final RendererModel bodyBottom; + private final ModelRenderer bodyAnchor; + private final ModelRenderer bodyTop; + private final ModelRenderer bodyBottom; - private final RendererModel armLAnchor; - private final RendererModel armL; - private final RendererModel armLpauldron; - private final RendererModel armLbranch1; - private final RendererModel armLbranch2; + private final ModelRenderer armLAnchor; + private final ModelRenderer armL; + private final ModelRenderer armLpauldron; + private final ModelRenderer armLbranch1; + private final ModelRenderer armLbranch2; - private final RendererModel armRAnchor; - private final RendererModel armR; - private final RendererModel armRpauldron; - private final RendererModel armRbranch1; - private final RendererModel armRbranch2; + private final ModelRenderer armRAnchor; + private final ModelRenderer armR; + private final ModelRenderer armRpauldron; + private final ModelRenderer armRbranch1; + private final ModelRenderer armRbranch2; - private final RendererModel pantsAnchor; - private final RendererModel belt; - private final RendererModel legL; - private final RendererModel legR; + private final ModelRenderer pantsAnchor; + private final ModelRenderer belt; + private final ModelRenderer legL; + private final ModelRenderer legR; - private final RendererModel bootL; - private final RendererModel bootLtop; - private final RendererModel bootLbranch1; - private final RendererModel bootLbranch2; + private final ModelRenderer bootL; + private final ModelRenderer bootLtop; + private final ModelRenderer bootLbranch1; + private final ModelRenderer bootLbranch2; - private final RendererModel bootR; - private final RendererModel bootRtop; - private final RendererModel bootRbranch1; - private final RendererModel bootRbranch2; + private final ModelRenderer bootR; + private final ModelRenderer bootRtop; + private final ModelRenderer bootRbranch1; + private final ModelRenderer bootRbranch2; public ModelArmorTerrasteel(EquipmentSlotType slot) { super(slot); @@ -72,163 +72,163 @@ public class ModelArmorTerrasteel extends ModelArmor { float s = 0.01F; //helm - this.helmAnchor = new RendererModel(this, 0, 0); + this.helmAnchor = new ModelRenderer(this, 0, 0); this.helmAnchor.setRotationPoint(0.0F, 0.0F, 0.0F); - this.helmAnchor.addBox(-1.0F, -2.0F, 0.0F, 2, 2, 2, s); - this.helm = new RendererModel(this, 0, 0); + this.helmAnchor.addCuboid(-1.0F, -2.0F, 0.0F, 2, 2, 2, s); + this.helm = new ModelRenderer(this, 0, 0); this.helm.setRotationPoint(0.0F, 0.0F, 0.0F); - this.helm.addBox(-4.5F, -9.0F, -4.5F, 9, 11, 9, s); - this.helmFront = new RendererModel(this, 36, 0); + this.helm.addCuboid(-4.5F, -9.0F, -4.5F, 9, 11, 9, s); + this.helmFront = new ModelRenderer(this, 36, 0); this.helmFront.setRotationPoint(0.0F, 0.0F, 0.0F); - this.helmFront.addBox(-1.5F, -10.0F, -5.5F, 3, 8, 7, s); - this.helmLeaf1l = new RendererModel(this, 56, 14); + this.helmFront.addCuboid(-1.5F, -10.0F, -5.5F, 3, 8, 7, s); + this.helmLeaf1l = new ModelRenderer(this, 56, 14); this.helmLeaf1l.mirror = true; this.helmLeaf1l.setRotationPoint(4.5F, -6.0F, -2.5F); - this.helmLeaf1l.addBox(0.0F, -3.0F, -1.0F, 2, 3, 1, s); + this.helmLeaf1l.addCuboid(0.0F, -3.0F, -1.0F, 2, 3, 1, s); this.setRotateAngle(helmLeaf1l, -0.2617993877991494F, -0.2617993877991494F, 0.5235987755982988F); - this.helmLeaf2l = new RendererModel(this, 56, 8); + this.helmLeaf2l = new ModelRenderer(this, 56, 8); this.helmLeaf2l.mirror = true; this.helmLeaf2l.setRotationPoint(4.5F, -6.0F, -0.5F); - this.helmLeaf2l.addBox(0.0F, -5.0F, -1.0F, 2, 5, 1, s); + this.helmLeaf2l.addCuboid(0.0F, -5.0F, -1.0F, 2, 5, 1, s); this.setRotateAngle(helmLeaf2l, -0.5235987755982988F, -0.5235987755982988F, 0.7853981633974483F); - this.helmLeaf3l = new RendererModel(this, 56, 0); + this.helmLeaf3l = new ModelRenderer(this, 56, 0); this.helmLeaf3l.mirror = true; this.helmLeaf3l.setRotationPoint(4.5F, -6.0F, 2.5F); - this.helmLeaf3l.addBox(0.0F, -7.0F, -1.0F, 2, 7, 1, s); + this.helmLeaf3l.addCuboid(0.0F, -7.0F, -1.0F, 2, 7, 1, s); this.setRotateAngle(helmLeaf3l, -0.7853981633974483F, -0.7853981633974483F, 0.7853981633974483F); - this.helmLeaf1r = new RendererModel(this, 56, 14); + this.helmLeaf1r = new ModelRenderer(this, 56, 14); this.helmLeaf1r.setRotationPoint(-4.5F, -6.0F, -2.5F); - this.helmLeaf1r.addBox(-2.0F, -3.0F, -1.0F, 2, 3, 1, s); + this.helmLeaf1r.addCuboid(-2.0F, -3.0F, -1.0F, 2, 3, 1, s); this.setRotateAngle(helmLeaf1r, -0.2617993877991494F, 0.2617993877991494F, -0.5235987755982988F); - this.helmLeaf2r = new RendererModel(this, 56, 8); + this.helmLeaf2r = new ModelRenderer(this, 56, 8); this.helmLeaf2r.setRotationPoint(-4.5F, -6.0F, -0.5F); - this.helmLeaf2r.addBox(-2.0F, -5.0F, -1.0F, 2, 5, 1, s); + this.helmLeaf2r.addCuboid(-2.0F, -5.0F, -1.0F, 2, 5, 1, s); this.setRotateAngle(helmLeaf2r, -0.5235987755982988F, 0.5235987755982988F, -0.7853981633974483F); - this.helmLeaf3r = new RendererModel(this, 56, 0); + this.helmLeaf3r = new ModelRenderer(this, 56, 0); this.helmLeaf3r.setRotationPoint(-4.5F, -6.0F, 2.5F); - this.helmLeaf3r.addBox(-2.0F, -7.0F, -1.0F, 2, 7, 1, s); + this.helmLeaf3r.addCuboid(-2.0F, -7.0F, -1.0F, 2, 7, 1, s); this.setRotateAngle(helmLeaf3r, -0.7853981633974483F, 0.7853981633974483F, -0.7853981633974483F); - this.helmbranch1l = new RendererModel(this, 36, 15); + this.helmbranch1l = new ModelRenderer(this, 36, 15); this.helmbranch1l.mirror = true; this.helmbranch1l.setRotationPoint(2.5F, -9.0F, -3.5F); - this.helmbranch1l.addBox(-1.0F, -1.0F, 0.0F, 2, 2, 7, s); + this.helmbranch1l.addCuboid(-1.0F, -1.0F, 0.0F, 2, 2, 7, s); this.setRotateAngle(helmbranch1l, 0.5235987755982988F, 0.2617993877991494F, 0.0F); - this.helmbranch2l = new RendererModel(this, 36, 15); + this.helmbranch2l = new ModelRenderer(this, 36, 15); this.helmbranch2l.mirror = true; this.helmbranch2l.setRotationPoint(4.5F, -3.0F, -2.5F); - this.helmbranch2l.addBox(-1.0F, -1.0F, 0.0F, 2, 2, 7, s); + this.helmbranch2l.addCuboid(-1.0F, -1.0F, 0.0F, 2, 2, 7, s); this.setRotateAngle(helmbranch2l, 0.08726646259971647F, 0.2617993877991494F, 0.0F); - this.helmbranch1r = new RendererModel(this, 36, 15); + this.helmbranch1r = new ModelRenderer(this, 36, 15); this.helmbranch1r.setRotationPoint(-2.5F, -9.0F, -3.5F); - this.helmbranch1r.addBox(-1.0F, -1.0F, 0.0F, 2, 2, 7, s); + this.helmbranch1r.addCuboid(-1.0F, -1.0F, 0.0F, 2, 2, 7, s); this.setRotateAngle(helmbranch1r, 0.5235987755982988F, -0.2617993877991494F, 0.0F); - this.helmbranch2r = new RendererModel(this, 36, 15); + this.helmbranch2r = new ModelRenderer(this, 36, 15); this.helmbranch2r.setRotationPoint(-4.5F, -3.0F, -2.5F); - this.helmbranch2r.addBox(-1.0F, -1.0F, 0.0F, 2, 2, 7, s); + this.helmbranch2r.addCuboid(-1.0F, -1.0F, 0.0F, 2, 2, 7, s); this.setRotateAngle(helmbranch2r, 0.08726646259971647F, -0.2617993877991494F, 0.0F); //body - this.bodyAnchor = new RendererModel(this, 0, 0); + this.bodyAnchor = new ModelRenderer(this, 0, 0); this.bodyAnchor.setRotationPoint(0.0F, 0.0F, 0.0F); - this.bodyAnchor.addBox(-1.0F, 0.0F, -1.0F, 2, 2, 2, s); - this.bodyTop = new RendererModel(this, 0, 20); + this.bodyAnchor.addCuboid(-1.0F, 0.0F, -1.0F, 2, 2, 2, s); + this.bodyTop = new ModelRenderer(this, 0, 20); this.bodyTop.setRotationPoint(0.0F, 0.0F, 0.0F); - this.bodyTop.addBox(-5.5F, 0.0F, -3.0F, 11, 6, 6, s); - this.bodyBottom = new RendererModel(this, 0, 32); + this.bodyTop.addCuboid(-5.5F, 0.0F, -3.0F, 11, 6, 6, s); + this.bodyBottom = new ModelRenderer(this, 0, 32); this.bodyBottom.setRotationPoint(0.0F, 0.0F, 0.0F); - this.bodyBottom.addBox(-4.5F, 5.0F, -2.5F, 9, 3, 5, s); + this.bodyBottom.addCuboid(-4.5F, 5.0F, -2.5F, 9, 3, 5, s); //armL - this.armLAnchor = new RendererModel(this, 0, 0); + this.armLAnchor = new ModelRenderer(this, 0, 0); this.armLAnchor.mirror = true; this.armLAnchor.setRotationPoint(4.0F, 2.0F, 0.0F); - this.armLAnchor.addBox(0.0F, -1.0F, -1.0F, 2, 2, 2, s); - this.armL = new RendererModel(this, 0, 52); + this.armLAnchor.addCuboid(0.0F, -1.0F, -1.0F, 2, 2, 2, s); + this.armL = new ModelRenderer(this, 0, 52); this.armL.mirror = true; this.armL.setRotationPoint(0.0F, 0.0F, 0.0F); - this.armL.addBox(-1.5F, 3.0F, -2.49F, 5, 8, 5, s); - this.armLpauldron = new RendererModel(this, 0, 40); + this.armL.addCuboid(-1.5F, 3.0F, -2.49F, 5, 8, 5, s); + this.armLpauldron = new ModelRenderer(this, 0, 40); this.armLpauldron.mirror = true; this.armLpauldron.setRotationPoint(1.5F, 0.0F, 0.0F); - this.armLpauldron.addBox(-1.0F, -3.0F, -3.0F, 6, 6, 6, s); - this.armLbranch1 = new RendererModel(this, 36, 15); + this.armLpauldron.addCuboid(-1.0F, -3.0F, -3.0F, 6, 6, 6, s); + this.armLbranch1 = new ModelRenderer(this, 36, 15); this.armLbranch1.mirror = true; this.armLbranch1.setRotationPoint(4.0F, -3.0F, -1.0F); - this.armLbranch1.addBox(-1.0F, -1.0F, 0.0F, 2, 2, 7, s); + this.armLbranch1.addCuboid(-1.0F, -1.0F, 0.0F, 2, 2, 7, s); this.setRotateAngle(armLbranch1, 0.5235987755982988F, 0.5235987755982988F, 0.0F); - this.armLbranch2 = new RendererModel(this, 36, 24); + this.armLbranch2 = new ModelRenderer(this, 36, 24); this.armLbranch2.mirror = true; this.armLbranch2.setRotationPoint(5.0F, -2.0F, 0.0F); - this.armLbranch2.addBox(-1.0F, 0.0F, 0.0F, 2, 2, 5, s); + this.armLbranch2.addCuboid(-1.0F, 0.0F, 0.0F, 2, 2, 5, s); this.setRotateAngle(armLbranch2, 0.08726646259971647F, 0.7853981633974483F, 0.0F); //armR - this.armRAnchor = new RendererModel(this, 0, 0); + this.armRAnchor = new ModelRenderer(this, 0, 0); this.armRAnchor.mirror = true; this.armRAnchor.setRotationPoint(-4.0F, 2.0F, 0.0F); - this.armRAnchor.addBox(-2.0F, -1.0F, -1.0F, 2, 2, 2, s); - this.armR = new RendererModel(this, 0, 52); + this.armRAnchor.addCuboid(-2.0F, -1.0F, -1.0F, 2, 2, 2, s); + this.armR = new ModelRenderer(this, 0, 52); this.armR.setRotationPoint(0.0F, 0.0F, 0.0F); - this.armR.addBox(-3.5F, 3.0F, -2.51F, 5, 8, 5, s); - this.armRpauldron = new RendererModel(this, 0, 40); + this.armR.addCuboid(-3.5F, 3.0F, -2.51F, 5, 8, 5, s); + this.armRpauldron = new ModelRenderer(this, 0, 40); this.armRpauldron.setRotationPoint(-1.5F, 0.0F, 0.0F); - this.armRpauldron.addBox(-5.0F, -3.0F, -3.0F, 6, 6, 6, s); - this.armRbranch1 = new RendererModel(this, 36, 15); + this.armRpauldron.addCuboid(-5.0F, -3.0F, -3.0F, 6, 6, 6, s); + this.armRbranch1 = new ModelRenderer(this, 36, 15); this.armRbranch1.setRotationPoint(-4.0F, -3.0F, -1.0F); - this.armRbranch1.addBox(-1.0F, -1.0F, 0.0F, 2, 2, 7, s); + this.armRbranch1.addCuboid(-1.0F, -1.0F, 0.0F, 2, 2, 7, s); this.setRotateAngle(armRbranch1, 0.5235987755982988F, -0.5235987755982988F, 0.0F); - this.armRbranch2 = new RendererModel(this, 36, 24); + this.armRbranch2 = new ModelRenderer(this, 36, 24); this.armRbranch2.setRotationPoint(-5.0F, -2.0F, 0.0F); - this.armRbranch2.addBox(-1.0F, 0.0F, 0.0F, 2, 2, 5, s); + this.armRbranch2.addCuboid(-1.0F, 0.0F, 0.0F, 2, 2, 5, s); this.setRotateAngle(armRbranch2, 0.08726646259971647F, -0.7853981633974483F, 0.0F); //pants - this.pantsAnchor = new RendererModel(this, 0, 0); + this.pantsAnchor = new ModelRenderer(this, 0, 0); this.pantsAnchor.setRotationPoint(0.0F, 0.0F, 0.0F); - this.pantsAnchor.addBox(-1.0F, 0.0F, -1.0F, 2, 2, 2, s); - this.belt = new RendererModel(this, 0, 65); + this.pantsAnchor.addCuboid(-1.0F, 0.0F, -1.0F, 2, 2, 2, s); + this.belt = new ModelRenderer(this, 0, 65); this.belt.setRotationPoint(0.0F, 0.0F, 0.0F); - this.belt.addBox(-4.5F, 8.0F, -3.0F, 9, 5, 6, s); - this.legL = new RendererModel(this, 0, 76); + this.belt.addCuboid(-4.5F, 8.0F, -3.0F, 9, 5, 6, s); + this.legL = new ModelRenderer(this, 0, 76); this.legL.mirror = true; this.legL.setRotationPoint(1.9F, 12.0F, 0.0F); - this.legL.addBox(-2.39F, -0.01F, -2.49F, 5, 6, 5, s); - this.legR = new RendererModel(this, 0, 76); + this.legL.addCuboid(-2.39F, -0.01F, -2.49F, 5, 6, 5, s); + this.legR = new ModelRenderer(this, 0, 76); this.legR.setRotationPoint(-1.9F, 12.0F, 0.0F); - this.legR.addBox(-2.61F, -0.01F, -2.51F, 5, 6, 5, s); + this.legR.addCuboid(-2.61F, -0.01F, -2.51F, 5, 6, 5, s); //boots - this.bootL = new RendererModel(this, 0, 94); + this.bootL = new ModelRenderer(this, 0, 94); this.bootL.mirror = true; this.bootL.setRotationPoint(1.9F, 12.0F, 0.0F); - this.bootL.addBox(-2.39F, 8.5F, -2.49F, 5, 4, 5, s); - this.bootLtop = new RendererModel(this, 0, 87); + this.bootL.addCuboid(-2.39F, 8.5F, -2.49F, 5, 4, 5, s); + this.bootLtop = new ModelRenderer(this, 0, 87); this.bootLtop.mirror = true; this.bootLtop.setRotationPoint(0.0F, 0.0F, 0.0F); - this.bootLtop.addBox(-2.39F, 6.0F, -2.49F, 6, 2, 5, s); - this.bootLbranch1 = new RendererModel(this, 36, 15); + this.bootLtop.addCuboid(-2.39F, 6.0F, -2.49F, 6, 2, 5, s); + this.bootLbranch1 = new ModelRenderer(this, 36, 15); this.bootLbranch1.mirror = true; this.bootLbranch1.setRotationPoint(3.5F, 6.0F, 0.0F); - this.bootLbranch1.addBox(-1.0F, -1.0F, 0.0F, 2, 2, 7,s); + this.bootLbranch1.addCuboid(-1.0F, -1.0F, 0.0F, 2, 2, 7,s); this.setRotateAngle(bootLbranch1, 0.2617993877991494F, 0.2617993877991494F, -0.08726646259971647F); - this.bootLbranch2 = new RendererModel(this, 36, 24); + this.bootLbranch2 = new ModelRenderer(this, 36, 24); this.bootLbranch2.mirror = true; this.bootLbranch2.setRotationPoint(2.5F, 9.0F, 0.0F); - this.bootLbranch2.addBox(-1.0F, -1.0F, 0.0F, 2, 2, 5, s); + this.bootLbranch2.addCuboid(-1.0F, -1.0F, 0.0F, 2, 2, 5, s); this.setRotateAngle(bootLbranch2, 0.08726646259971647F, 0.7853981633974483F, 0.0F); - this.bootR = new RendererModel(this, 0, 94); + this.bootR = new ModelRenderer(this, 0, 94); this.bootR.setRotationPoint(-1.9F, 12.0F, 0.0F); - this.bootR.addBox(-2.61F, 8.5F, -2.51F, 5, 4, 5, s); - this.bootRtop = new RendererModel(this, 0, 87); + this.bootR.addCuboid(-2.61F, 8.5F, -2.51F, 5, 4, 5, s); + this.bootRtop = new ModelRenderer(this, 0, 87); this.bootRtop.setRotationPoint(0.0F, 0.0F, 0.0F); - this.bootRtop.addBox(-3.61F, 6.0F, -2.51F, 6, 2, 5, s); - this.bootRbranch1 = new RendererModel(this, 36, 15); + this.bootRtop.addCuboid(-3.61F, 6.0F, -2.51F, 6, 2, 5, s); + this.bootRbranch1 = new ModelRenderer(this, 36, 15); this.bootRbranch1.setRotationPoint(-3.5F, 6.0F, 0.0F); - this.bootRbranch1.addBox(-1.0F, -1.0F, 0.0F, 2, 2, 7, s); + this.bootRbranch1.addCuboid(-1.0F, -1.0F, 0.0F, 2, 2, 7, s); this.setRotateAngle(bootRbranch1, 0.2617993877991494F, -0.2617993877991494F, 0.08726646259971647F); - this.bootRbranch2 = new RendererModel(this, 36, 24); + this.bootRbranch2 = new ModelRenderer(this, 36, 24); this.bootRbranch2.setRotationPoint(-2.5F, 9.0F, 0.5F); - this.bootRbranch2.addBox(-1.0F, -1.0F, 0.0F, 2, 2, 5, s); + this.bootRbranch2.addCuboid(-1.0F, -1.0F, 0.0F, 2, 2, 5, s); this.setRotateAngle(bootRbranch2, 0.08726646259971647F, -0.7853981633974483F, 0.0F); //hierarchy diff --git a/src/main/java/vazkii/botania/client/render/entity/RenderPoolMinecart.java b/src/main/java/vazkii/botania/client/render/entity/RenderPoolMinecart.java index 33145a36c..d138d3fa3 100644 --- a/src/main/java/vazkii/botania/client/render/entity/RenderPoolMinecart.java +++ b/src/main/java/vazkii/botania/client/render/entity/RenderPoolMinecart.java @@ -32,7 +32,7 @@ public class RenderPoolMinecart extends MinecartRenderer { protected void renderCartContents(EntityPoolMinecart poolCart, float partialTicks, @Nonnull BlockState state) { super.renderCartContents(poolCart, partialTicks, state); RenderTilePool.cartMana = poolCart.getMana(); - TileEntityRendererDispatcher.instance.getRenderer(TilePool.class).render(null, poolCart.posX, poolCart.posY, poolCart.posZ, ClientTickHandler.partialTicks, -1); + TileEntityRendererDispatcher.instance.getRenderer(TilePool.class).render(null, poolCart.getX(), poolCart.getY(), poolCart.getZ(), ClientTickHandler.partialTicks, -1); } diff --git a/src/main/java/vazkii/botania/client/render/world/SkyblockSkyRenderer.java b/src/main/java/vazkii/botania/client/render/world/SkyblockSkyRenderer.java index 841495ce5..c56b0092a 100644 --- a/src/main/java/vazkii/botania/client/render/world/SkyblockSkyRenderer.java +++ b/src/main/java/vazkii/botania/client/render/world/SkyblockSkyRenderer.java @@ -59,8 +59,8 @@ public class SkyblockSkyRenderer implements IRenderHandler { // Botania - darken when in void float insideVoid = 0; - if(mc.player.posY <= -2) - insideVoid = (float) Math.min(1F, -(mc.player.posY + 2) / 30F); + if(mc.player.getY() <= -2) + insideVoid = (float) Math.min(1F, -(mc.player.getY() + 2) / 30F); f = Math.max(0F, f - insideVoid); f1 = Math.max(0F, f1 - insideVoid); diff --git a/src/main/java/vazkii/botania/common/block/BlockAltar.java b/src/main/java/vazkii/botania/common/block/BlockAltar.java index 5447c4aa8..ca1c68afe 100644 --- a/src/main/java/vazkii/botania/common/block/BlockAltar.java +++ b/src/main/java/vazkii/botania/common/block/BlockAltar.java @@ -29,7 +29,7 @@ import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.world.IBlockReader; -import net.minecraft.world.IEnviromentBlockReader; +import net.minecraft.world.ILightReader; import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -100,7 +100,7 @@ public class BlockAltar extends BlockMod { } @Override - public int getLightValue(@Nonnull BlockState state, IEnviromentBlockReader world, @Nonnull BlockPos pos) { + public int getLightValue(@Nonnull BlockState state, ILightReader world, @Nonnull BlockPos pos) { if(world.getBlockState(pos).getBlock() != this) return world.getBlockState(pos).getLightValue(world, pos); TileAltar tile = (TileAltar) world.getTileEntity(pos); diff --git a/src/main/java/vazkii/botania/common/block/BlockCraftyCrate.java b/src/main/java/vazkii/botania/common/block/BlockCraftyCrate.java index fc3919f4b..5a9156434 100644 --- a/src/main/java/vazkii/botania/common/block/BlockCraftyCrate.java +++ b/src/main/java/vazkii/botania/common/block/BlockCraftyCrate.java @@ -47,8 +47,8 @@ public class BlockCraftyCrate extends BlockOpenCrate implements IWandHUD { int width = 52; int height = 52; - int xc = mc.mainWindow.getScaledWidth() / 2 + 20; - int yc = mc.mainWindow.getScaledHeight() / 2 - height / 2; + int xc = mc.getWindow().getScaledWidth() / 2 + 20; + int yc = mc.getWindow().getScaledHeight() / 2 - height / 2; AbstractGui.fill(xc - 6, yc - 6, xc + width + 6, yc + height + 6, 0x22000000); AbstractGui.fill(xc - 4, yc - 4, xc + width + 4, yc + height + 4, 0x22000000); diff --git a/src/main/java/vazkii/botania/common/block/BlockFloatingSpecialFlower.java b/src/main/java/vazkii/botania/common/block/BlockFloatingSpecialFlower.java index 59d63896b..36c74824a 100644 --- a/src/main/java/vazkii/botania/common/block/BlockFloatingSpecialFlower.java +++ b/src/main/java/vazkii/botania/common/block/BlockFloatingSpecialFlower.java @@ -22,7 +22,7 @@ import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import net.minecraft.world.IBlockReader; -import net.minecraft.world.IEnviromentBlockReader; +import net.minecraft.world.ILightReader; import net.minecraft.world.World; import net.minecraft.world.storage.loot.LootContext; import net.minecraft.world.storage.loot.LootParameters; @@ -47,7 +47,7 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I } @Override - public int getLightValue(@Nonnull BlockState state, IEnviromentBlockReader world, @Nonnull BlockPos pos) { + public int getLightValue(@Nonnull BlockState state, ILightReader world, @Nonnull BlockPos pos) { TileEntity tile = world.getTileEntity(pos); return tile instanceof TileEntitySpecialFlower ? ((TileEntitySpecialFlower) tile).getLightValue() : lightValue; } diff --git a/src/main/java/vazkii/botania/common/block/BlockPlatform.java b/src/main/java/vazkii/botania/common/block/BlockPlatform.java index 5327be4ac..983e9ec5d 100644 --- a/src/main/java/vazkii/botania/common/block/BlockPlatform.java +++ b/src/main/java/vazkii/botania/common/block/BlockPlatform.java @@ -20,7 +20,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.BlockRenderLayer; +import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; @@ -35,6 +35,7 @@ import vazkii.botania.api.wand.IWandable; import vazkii.botania.common.block.tile.TilePlatform; import javax.annotation.Nonnull; +import javax.annotation.Nullable; public class BlockPlatform extends BlockMod implements IWandable, IManaCollisionGhost { @@ -58,8 +59,8 @@ public class BlockPlatform extends BlockMod implements IWandable, IManaCollision if(variant == Variant.INFRANGIBLE || variant == Variant.ABSTRUSE && e != null - && e.posY > pos.getY() + 0.9 - && !context.isSneaking()) { + && e.getY() > pos.getY() + 0.9 + && !context.isDescending()) { return super.getCollisionShape(state, world, pos, context); } else { return VoxelShapes.empty(); @@ -98,12 +99,13 @@ public class BlockPlatform extends BlockMod implements IWandable, IManaCollision return true; } - public static boolean isValidBlock(BlockState state, World world, BlockPos pos) { - return state.isOpaqueCube(world, pos) || state.getRenderType() == BlockRenderType.MODEL; + public static boolean isValidBlock(@Nullable BlockState state, World world, BlockPos pos) { + return state != null && (state.isOpaqueCube(world, pos) || state.getRenderType() == BlockRenderType.MODEL); } + @Nonnull @Override - public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) { + public ActionResultType onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) { TileEntity tile = world.getTileEntity(pos); ItemStack currentStack = player.getHeldItem(hand); if(!currentStack.isEmpty() @@ -119,11 +121,11 @@ public class BlockPlatform extends BlockMod implements IWandable, IManaCollision world.notifyBlockUpdate(pos, state, state, 3); } - return true; + return ActionResultType.SUCCESS; } } - return false; + return ActionResultType.PASS; } diff --git a/src/main/java/vazkii/botania/common/block/BlockSpecialFlower.java b/src/main/java/vazkii/botania/common/block/BlockSpecialFlower.java index e13297766..b464acc8e 100644 --- a/src/main/java/vazkii/botania/common/block/BlockSpecialFlower.java +++ b/src/main/java/vazkii/botania/common/block/BlockSpecialFlower.java @@ -20,6 +20,7 @@ import net.minecraft.item.DyeColor; import net.minecraft.item.ItemStack; import net.minecraft.potion.Effects; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ActionResultType; import net.minecraft.util.Direction; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; @@ -28,7 +29,7 @@ import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; -import net.minecraft.world.IEnviromentBlockReader; +import net.minecraft.world.ILightReader; import net.minecraft.world.World; import net.minecraft.world.storage.loot.LootContext; import net.minecraft.world.storage.loot.LootParameters; @@ -61,7 +62,7 @@ public class BlockSpecialFlower extends FlowerBlock implements IWandable, IWandH } @Override - public int getLightValue(@Nonnull BlockState state, IEnviromentBlockReader world, @Nonnull BlockPos pos) { + public int getLightValue(@Nonnull BlockState state, ILightReader world, @Nonnull BlockPos pos) { TileEntity te = world.getTileEntity(pos); if (te instanceof TileEntitySpecialFlower) { return ((TileEntitySpecialFlower) te).getLightValue(); @@ -152,14 +153,14 @@ public class BlockSpecialFlower extends FlowerBlock implements IWandable, IWandH } @Override - public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) { + public ActionResultType onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) { ItemStack stack = player.getHeldItem(hand); if(!stack.isEmpty() && stack.getItem() instanceof ItemDye) { DyeColor newColor = ((ItemDye) stack.getItem()).color; DyeColor oldColor = state.get(BotaniaStateProps.COLOR); if(newColor != oldColor) world.setBlockState(pos, state.with(BotaniaStateProps.COLOR, newColor), 1 | 2); - return true; + return ActionResultType.SUCCESS; } return ((TileEntitySpecialFlower) world.getTileEntity(pos)).onBlockActivated(world, pos, state, player, hand, hit); diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockManaFlame.java b/src/main/java/vazkii/botania/common/block/decor/BlockManaFlame.java index 7353c3d26..315837a77 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockManaFlame.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockManaFlame.java @@ -16,6 +16,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.tags.ItemTags; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ActionResultType; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; @@ -52,7 +53,7 @@ public class BlockManaFlame extends BlockMod { } @Override - public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) { + public ActionResultType onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) { if(Botania.gardenOfGlassLoaded) { ItemStack stack = player.getHeldItem(hand); if(!stack.isEmpty() && ItemTags.SAPLINGS.contains(stack.getItem()) && !player.inventory.hasItemStack(new ItemStack(ModItems.lexicon))) { @@ -60,11 +61,11 @@ public class BlockManaFlame extends BlockMod { stack.shrink(1); ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(ModItems.lexicon)); } - return true; + return ActionResultType.SUCCESS; } } - return false; + return ActionResultType.PASS; } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java index 4823e4cd6..eb7a6dec9 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileHopperhock.java @@ -242,8 +242,8 @@ public class SubTileHopperhock extends TileEntityFunctionalFlower { String filter = I18n.format("botaniamisc.filter" + filterType); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - int x = mc.mainWindow.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(filter) / 2; - int y = mc.mainWindow.getScaledHeight() / 2 + 30; + int x = mc.getWindow().getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(filter) / 2; + int y = mc.getWindow().getScaledHeight() / 2 + 30; mc.fontRenderer.drawStringWithShadow(filter, x, y, color); GlStateManager.disableBlend(); diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileLoonuim.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileLoonuim.java index d944f8fac..45d04cacd 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileLoonuim.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileLoonuim.java @@ -200,7 +200,7 @@ public class SubTileLoonuim extends TileEntityFunctionalFlower { CompoundNBT cmp = e.getPersistentData().getCompound(TAG_ITEMSTACK_TO_DROP); ItemStack stack = ItemStack.read(cmp); event.getDrops().clear(); - event.getDrops().add(new ItemEntity(e.world, e.posX, e.posY, e.posZ, stack)); + event.getDrops().add(new ItemEntity(e.world, e.getX(), e.getY(), e.getZ(), stack)); } } } diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileRannuncarpus.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileRannuncarpus.java index 8ed42ed16..f4e214e33 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileRannuncarpus.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileRannuncarpus.java @@ -155,8 +155,8 @@ public class SubTileRannuncarpus extends TileEntityFunctionalFlower { if(!recieverStack.isEmpty()) { ITextComponent stackName = recieverStack.getDisplayName(); int width = 16 + mc.fontRenderer.getStringWidth(stackName.getString()) / 2; - int x = mc.mainWindow.getScaledWidth() / 2 - width; - int y = mc.mainWindow.getScaledHeight() / 2 + 30; + int x = mc.getWindow().getScaledWidth() / 2 - width; + int y = mc.getWindow().getScaledHeight() / 2 + 30; mc.fontRenderer.drawStringWithShadow(stackName.getFormattedText(), x + 20, y + 5, color); RenderHelper.enableGUIStandardItemLighting(); diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSolegnolia.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSolegnolia.java index c1f57753e..ff8e5da9f 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSolegnolia.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSolegnolia.java @@ -56,7 +56,7 @@ public class SubTileSolegnolia extends TileEntityFunctionalFlower { return existingFlowers.stream() .filter(f -> f.redstoneSignal == 0) .filter(f -> f.getWorld() == e.world) - .anyMatch(f -> f.getEffectivePos().distanceSq(e.posX, e.posY, e.posZ, false) <= f.getRange() * f.getRange()); + .anyMatch(f -> f.getEffectivePos().distanceSq(e.getX(), e.getY(), e.getZ(), false) <= f.getRange() * f.getRange()); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSpectranthemum.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSpectranthemum.java index d01bef1f7..7a0810c01 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSpectranthemum.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileSpectranthemum.java @@ -95,7 +95,7 @@ public class SubTileSpectranthemum extends TileEntityFunctionalFlower { } static void spawnExplosionParticles(Entity item, int p) { - PacketHandler.sendToNearby(item.world, new BlockPos(item), new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.ITEM_SMOKE, item.posX, item.posY, item.posZ, item.getEntityId(), p)); + PacketHandler.sendToNearby(item.world, new BlockPos(item), new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.ITEM_SMOKE, item.getX(), item.getY(), item.getZ(), item.getEntityId(), p)); } @Override diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileTangleberrie.java b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileTangleberrie.java index 63f30eb84..2dac77ca6 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileTangleberrie.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/SubTileTangleberrie.java @@ -56,9 +56,9 @@ public class SubTileTangleberrie extends TileEntityFunctionalFlower { if(entity instanceof PlayerEntity || !entity.isNonBoss()) continue; - double x2 = entity.posX; - double y2 = entity.posY; - double z2 = entity.posZ; + double x2 = entity.getX(); + double y2 = entity.getY(); + double z2 = entity.getZ(); float distance = MathHelper.pointDistanceSpace(x1, y1, z1, x2, y2, z2); diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java index 61f83995b..764dce1c8 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEndoflame.java @@ -92,8 +92,8 @@ public class SubTileEndoflame extends TileEntityGeneratingFlower { if(event == START_BURN_EVENT) { Entity e = getWorld().getEntityByID(param); if(e != null) { - e.world.addParticle(ParticleTypes.LARGE_SMOKE, e.posX, e.posY + 0.1, e.posZ, 0.0D, 0.0D, 0.0D); - e.world.addParticle(ParticleTypes.FLAME, e.posX, e.posY, e.posZ, 0.0D, 0.0D, 0.0D); + e.world.addParticle(ParticleTypes.LARGE_SMOKE, e.getX(), e.getY() + 0.1, e.getZ(), 0.0D, 0.0D, 0.0D); + e.world.addParticle(ParticleTypes.FLAME, e.getX(), e.getY(), e.getZ(), 0.0D, 0.0D, 0.0D); } return true; } else { diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEntropinnyum.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEntropinnyum.java index 58ad51103..aa3ed9ef6 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEntropinnyum.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileEntropinnyum.java @@ -64,10 +64,10 @@ public class SubTileEntropinnyum extends TileEntityGeneratingFlower { for(int i = 0; i < 50; i++) { SparkleParticleData data = SparkleParticleData.sparkle((float) (Math.random() * 0.65F + 1.25F), 1F, (float) Math.random() * 0.25F, (float) Math.random() * 0.25F, 12); - world.addParticle(data, e.posX + Math.random() * 4 - 2, e.posY + Math.random() * 4 - 2, e.posZ + Math.random() * 4 - 2, 0, 0, 0); + world.addParticle(data, e.getX() + Math.random() * 4 - 2, e.getY() + Math.random() * 4 - 2, e.getZ() + Math.random() * 4 - 2, 0, 0, 0); } - getWorld().addParticle(ParticleTypes.EXPLOSION_EMITTER, e.posX, e.posY, e.posZ, 1D, 0D, 0D); + getWorld().addParticle(ParticleTypes.EXPLOSION_EMITTER, e.getX(), e.getY(), e.getZ(), 1D, 0D, 0D); } return true; } else { diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java index 7b1760849..972f65bd5 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileGourmaryllis.java @@ -99,7 +99,7 @@ public class SubTileGourmaryllis extends TileEntityGeneratingFlower { cooldown = val * 10; item.playSound(SoundEvents.ENTITY_GENERIC_EAT, 0.2F, 0.6F); sync(); - ((ServerWorld) getWorld()).spawnParticle(new ItemParticleData(ParticleTypes.ITEM, stack), item.posX, item.posY, item.posZ, 20, 0.1D, 0.1D, 0.1D, 0.05D); + ((ServerWorld) getWorld()).spawnParticle(new ItemParticleData(ParticleTypes.ITEM, stack), item.getX(), item.getY(), item.getZ(), 20, 0.1D, 0.1D, 0.1D, 0.05D); } item.remove(); diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileNarslimmus.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileNarslimmus.java index a3e3c6b15..eb55baa87 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileNarslimmus.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileNarslimmus.java @@ -68,7 +68,7 @@ public class SubTileNarslimmus extends TileEntityGeneratingFlower { float f2 = MathHelper.sin(f) * size * 0.5F * f1; float f3 = MathHelper.cos(f) * size * 0.5F * f1; float f4 = slime.world.rand.nextFloat() * size * 0.5F * f1; - slime.world.addParticle(ParticleTypes.ITEM_SLIME, slime.posX + f2, slime.getBoundingBox().minY + f4, slime.posZ + f3, 0.0D, 0.0D, 0.0D); + slime.world.addParticle(ParticleTypes.ITEM_SLIME, slime.getX() + f2, slime.getBoundingBox().minY + f4, slime.getZ() + f3, 0.0D, 0.0D, 0.0D); } break; } diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileShulkMeNot.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileShulkMeNot.java index 69aec7318..56b650bf3 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileShulkMeNot.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileShulkMeNot.java @@ -69,9 +69,9 @@ public class SubTileShulkMeNot extends TileEntityGeneratingFlower { if(world instanceof ServerWorld) { ServerWorld ws = (ServerWorld) world; ws.spawnParticle(ParticleTypes.EXPLOSION, - entity.posX + entity.getWidth() / 2, - entity.posY + entity.getHeight() / 2, - entity.posZ + entity.getWidth() / 2, + entity.getX() + entity.getWidth() / 2, + entity.getY() + entity.getHeight() / 2, + entity.getZ() + entity.getWidth() / 2, 100, entity.getWidth(), entity.getHeight(), entity.getWidth(), 0.05); ws.spawnParticle(ParticleTypes.PORTAL, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, 40, 0, 0, 0, 0.6); } diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileSpectrolus.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileSpectrolus.java index 8d4d88b41..50d43bd58 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileSpectrolus.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileSpectrolus.java @@ -84,10 +84,10 @@ public class SubTileSpectrolus extends TileEntityGeneratingFlower { sheep.playSound(SoundEvents.ENTITY_GENERIC_EAT, 1, 1); ItemStack morbid = new ItemStack(sheep.isBurning() ? Items.COOKED_MUTTON : Items.MUTTON); - ((ServerWorld) getWorld()).spawnParticle(new ItemParticleData(ParticleTypes.ITEM, morbid), target.posX, target.posY + target.getEyeHeight(), target.posZ, 20, 0.1D, 0.1D, 0.1D, 0.05D); + ((ServerWorld) getWorld()).spawnParticle(new ItemParticleData(ParticleTypes.ITEM, morbid), target.getX(), target.getY() + target.getEyeHeight(), target.getZ(), 20, 0.1D, 0.1D, 0.1D, 0.05D); ItemStack wool = new ItemStack(ModBlocks.getWool(sheep.getFleeceColor())); - ((ServerWorld) getWorld()).spawnParticle(new ItemParticleData(ParticleTypes.ITEM, wool), target.posX, target.posY + target.getEyeHeight(), target.posZ, 20, 0.1D, 0.1D, 0.1D, 0.05D); + ((ServerWorld) getWorld()).spawnParticle(new ItemParticleData(ParticleTypes.ITEM, wool), target.getX(), target.getY() + target.getEyeHeight(), target.getZ(), 20, 0.1D, 0.1D, 0.1D, 0.05D); } sheep.setHealth(0); } else if (target instanceof ItemEntity) { @@ -98,7 +98,7 @@ public class SubTileSpectrolus extends TileEntityGeneratingFlower { if(expected.asItem() == stack.getItem()) { addManaAndCycle(WOOL_GEN); - ((ServerWorld) getWorld()).spawnParticle(new ItemParticleData(ParticleTypes.ITEM, stack), target.posX, target.posY, target.posZ, 20, 0.1D, 0.1D, 0.1D, 0.05D); + ((ServerWorld) getWorld()).spawnParticle(new ItemParticleData(ParticleTypes.ITEM, stack), target.getX(), target.getY(), target.getZ(), 20, 0.1D, 0.1D, 0.1D, 0.05D); } target.remove(); @@ -141,8 +141,8 @@ public class SubTileSpectrolus extends TileEntityGeneratingFlower { if(!stack.isEmpty()) { ITextComponent stackName = stack.getDisplayName(); int width = 16 + mc.fontRenderer.getStringWidth(stackName.getString()) / 2; - int x = mc.mainWindow.getScaledWidth() / 2 - width; - int y = mc.mainWindow.getScaledHeight() / 2 + 30; + int x = mc.getWindow().getScaledWidth() / 2 - width; + int y = mc.getWindow().getScaledHeight() / 2 + 30; mc.fontRenderer.drawStringWithShadow(stackName.getFormattedText(), x + 20, y + 5, color); RenderHelper.enableGUIStandardItemLighting(); diff --git a/src/main/java/vazkii/botania/common/block/tile/TileAlfPortal.java b/src/main/java/vazkii/botania/common/block/tile/TileAlfPortal.java index 6bafbf53e..4660b0b57 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileAlfPortal.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileAlfPortal.java @@ -18,7 +18,7 @@ import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; -import net.minecraft.util.LazyLoadBase; +import net.minecraft.util.LazyValue; import net.minecraft.util.Rotation; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; @@ -52,7 +52,7 @@ public class TileAlfPortal extends TileMod implements ITickableTileEntity { @ObjectHolder(LibMisc.MOD_ID + ":" + LibBlockNames.ALF_PORTAL) public static TileEntityType TYPE; - public static final LazyLoadBase MULTIBLOCK = new LazyLoadBase<>(() -> PatchouliAPI.instance.makeMultiblock( + public static final LazyValue MULTIBLOCK = new LazyValue<>(() -> PatchouliAPI.instance.makeMultiblock( new String[][] { { "_", "W", "G", "W", "_" }, { "W", " ", " ", " ", "W" }, diff --git a/src/main/java/vazkii/botania/common/block/tile/TileAltar.java b/src/main/java/vazkii/botania/common/block/tile/TileAltar.java index e4f199291..37b85e5ac 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileAltar.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileAltar.java @@ -238,7 +238,7 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary, } if(didAny) { - player.world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_GENERIC_SPLASH, SoundCategory.BLOCKS, 0.1F, 10F); + player.world.playSound(null, player.getX(), player.getY(), player.getZ(), SoundEvents.ENTITY_GENERIC_SPLASH, SoundCategory.BLOCKS, 0.1F, 10F); ServerPlayerEntity mp = (ServerPlayerEntity) player; mp.container.detectAndSendChanges(); } @@ -359,8 +359,8 @@ public class TileAltar extends TileSimpleInventory implements IPetalApothecary, @OnlyIn(Dist.CLIENT) public void renderHUD(Minecraft mc) { - int xc = mc.mainWindow.getScaledWidth() / 2; - int yc = mc.mainWindow.getScaledHeight() / 2; + int xc = mc.getWindow().getScaledWidth() / 2; + int yc = mc.getWindow().getScaledHeight() / 2; float angle = -90; int radius = 24; diff --git a/src/main/java/vazkii/botania/common/block/tile/TileAnimatedTorch.java b/src/main/java/vazkii/botania/common/block/tile/TileAnimatedTorch.java index fcda7c43a..3e8258247 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileAnimatedTorch.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileAnimatedTorch.java @@ -133,8 +133,8 @@ public class TileAnimatedTorch extends TileMod implements ITickableTileEntity { @OnlyIn(Dist.CLIENT) public void renderHUD(Minecraft mc) { - int x = mc.mainWindow.getScaledWidth() / 2 + 10; - int y = mc.mainWindow.getScaledHeight() / 2 - 8; + int x = mc.getWindow().getScaledWidth() / 2 + 10; + int y = mc.getWindow().getScaledHeight() / 2 - 8; mc.getItemRenderer().renderItemAndEffectIntoGUI(new ItemStack(Blocks.REDSTONE_TORCH), x, y); mc.fontRenderer.drawStringWithShadow(I18n.format("botania.animatedTorch." + torchMode.name().toLowerCase()), x + 18, y + 6, 0xFF4444); diff --git a/src/main/java/vazkii/botania/common/block/tile/TileBrewery.java b/src/main/java/vazkii/botania/common/block/tile/TileBrewery.java index 74db441d8..a1437e493 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileBrewery.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileBrewery.java @@ -255,8 +255,8 @@ public class TileBrewery extends TileSimpleInventory implements IManaReceiver, I public void renderHUD(Minecraft mc) { int manaToGet = getManaCost(); if(manaToGet > 0) { - int x = mc.mainWindow.getScaledWidth() / 2 + 20; - int y = mc.mainWindow.getScaledHeight() / 2 - 8; + int x = mc.getWindow().getScaledWidth() / 2 + 20; + int y = mc.getWindow().getScaledHeight() / 2 - 8; if(recipe == null) return; diff --git a/src/main/java/vazkii/botania/common/block/tile/TileEnchanter.java b/src/main/java/vazkii/botania/common/block/tile/TileEnchanter.java index 2437dee41..a49d562da 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileEnchanter.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileEnchanter.java @@ -28,7 +28,7 @@ import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; -import net.minecraft.util.LazyLoadBase; +import net.minecraft.util.LazyValue; import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocationException; import net.minecraft.util.Rotation; @@ -111,7 +111,7 @@ public class TileEnchanter extends TileMod implements ISparkAttachable, ITickabl } }; - public static final LazyLoadBase MULTIBLOCK = new LazyLoadBase<>(() -> PatchouliAPI.instance.makeMultiblock( + public static final LazyValue MULTIBLOCK = new LazyValue<>(() -> PatchouliAPI.instance.makeMultiblock( PATTERN, 'P', ModBlocks.manaPylon, 'L', Blocks.LAPIS_BLOCK, @@ -120,7 +120,7 @@ public class TileEnchanter extends TileMod implements ISparkAttachable, ITickabl 'F', StateMatcher.fromPredicate(ModBlocks.whiteFlower, state -> state.getBlock().isIn(ModTags.Blocks.MYSTICAL_FLOWERS)) )); - private static final LazyLoadBase FORMED_MULTIBLOCK = new LazyLoadBase<>(() -> PatchouliAPI.instance.makeMultiblock( + private static final LazyValue FORMED_MULTIBLOCK = new LazyValue<>(() -> PatchouliAPI.instance.makeMultiblock( PATTERN, 'P', ModBlocks.manaPylon, 'L', ModBlocks.enchanter, @@ -478,8 +478,8 @@ public class TileEnchanter extends TileMod implements ISparkAttachable, ITickabl @OnlyIn(Dist.CLIENT) public void renderHUD() { if(manaRequired > 0 && !itemToEnchant.isEmpty()) { - int x = Minecraft.getInstance().mainWindow.getScaledWidth() / 2 + 20; - int y = Minecraft.getInstance().mainWindow.getScaledHeight() / 2 - 8; + int x = Minecraft.getInstance().getWindow().getScaledWidth() / 2 + 20; + int y = Minecraft.getInstance().getWindow().getScaledHeight() / 2 - 8; RenderHelper.renderProgressPie(x, y, (float) mana / (float) manaRequired, itemToEnchant); } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileHourglass.java b/src/main/java/vazkii/botania/common/block/tile/TileHourglass.java index 8c939d02e..a372f786d 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileHourglass.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileHourglass.java @@ -203,8 +203,8 @@ public class TileHourglass extends TileSimpleInventory implements ITickableTileE @OnlyIn(Dist.CLIENT) public void renderHUD() { Minecraft mc = Minecraft.getInstance(); - int x = mc.mainWindow.getScaledWidth() / 2 + 10; - int y = mc.mainWindow.getScaledHeight() / 2 - 10; + int x = mc.getWindow().getScaledWidth() / 2 + 10; + int y = mc.getWindow().getScaledHeight() / 2 - 10; ItemStack stack = itemHandler.getStackInSlot(0); if(!stack.isEmpty()) { diff --git a/src/main/java/vazkii/botania/common/block/tile/TileLightRelay.java b/src/main/java/vazkii/botania/common/block/tile/TileLightRelay.java index cfd953817..995de9dec 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileLightRelay.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileLightRelay.java @@ -123,9 +123,9 @@ public class TileLightRelay extends TileMod implements ITickableTileEntity, IWan List enderPearls = world.getEntitiesWithinAABB(EnderPearlEntity.class, aabb.grow(range)); for(EnderPearlEntity pearl : enderPearls) { pearl.setPositionAndUpdate( - endpoint.getX() + pearl.posX - pos.getX(), - endpoint.getY() + pearl.posY - pos.getY(), - endpoint.getZ() + pearl.posZ - pos.getZ() + endpoint.getX() + pearl.getX() - pos.getX(), + endpoint.getY() + pearl.getY() - pos.getY(), + endpoint.getZ() + pearl.getZ() - pos.getZ() ); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java b/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java index 55fe289e2..54b2852f9 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileRuneAltar.java @@ -351,8 +351,8 @@ public class TileRuneAltar extends TileSimpleInventory implements IManaReceiver, } public void renderHUD(Minecraft mc) { - int xc = mc.mainWindow.getScaledWidth() / 2; - int yc = mc.mainWindow.getScaledHeight() / 2; + int xc = mc.getWindow().getScaledWidth() / 2; + int yc = mc.getWindow().getScaledHeight() / 2; float angle = -90; int radius = 24; diff --git a/src/main/java/vazkii/botania/common/block/tile/TileSpawnerClaw.java b/src/main/java/vazkii/botania/common/block/tile/TileSpawnerClaw.java index 018842656..d19d0a82f 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileSpawnerClaw.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileSpawnerClaw.java @@ -113,10 +113,10 @@ public class TileSpawnerClaw extends TileMod implements IManaReceiver, ITickable return; } - entity.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, world.rand.nextFloat() * 360.0F, 0.0F); + entity.setLocationAndAngles(entity.getX(), entity.getY(), entity.getZ(), world.rand.nextFloat() * 360.0F, 0.0F); if (entity instanceof MobEntity) { MobEntity mobentity = (MobEntity)entity; - if (!net.minecraftforge.event.ForgeEventFactory.canEntitySpawnSpawner(mobentity, world, (float)entity.posX, (float)entity.posY, (float)entity.posZ, logic)) { + if (!net.minecraftforge.event.ForgeEventFactory.canEntitySpawnSpawner(mobentity, world, (float)entity.getX(), (float)entity.getY(), (float)entity.getZ(), logic)) { continue; } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileTerraPlate.java b/src/main/java/vazkii/botania/common/block/tile/TileTerraPlate.java index a00f7b682..28321482c 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileTerraPlate.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileTerraPlate.java @@ -19,7 +19,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.tileentity.TileEntityType; -import net.minecraft.util.LazyLoadBase; +import net.minecraft.util.LazyValue; import net.minecraft.util.SoundCategory; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; @@ -47,7 +47,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable, ITickab public static TileEntityType TYPE; public static final int MAX_MANA = TilePool.MAX_MANA / 2; - public static final LazyLoadBase MULTIBLOCK = new LazyLoadBase<>(() -> PatchouliAPI.instance.makeMultiblock( + public static final LazyValue MULTIBLOCK = new LazyValue<>(() -> PatchouliAPI.instance.makeMultiblock( new String[][] { { "___", @@ -103,7 +103,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable, ITickab if(otherItem != item) otherItem.remove(); else item.setItem(new ItemStack(ModItems.terrasteel)); - world.playSound(null, item.posX, item.posY, item.posZ, ModSounds.terrasteelCraft, SoundCategory.BLOCKS, 1, 1); + world.playSound(null, item.getX(), item.getY(), item.getZ(), ModSounds.terrasteelCraft, SoundCategory.BLOCKS, 1, 1); mana = 0; world.updateComparatorOutputLevel(pos, world.getBlockState(pos).getBlock()); VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos); diff --git a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaIndex.java b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaIndex.java index d43d0c259..b60159494 100644 --- a/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaIndex.java +++ b/src/main/java/vazkii/botania/common/block/tile/corporea/TileCorporeaIndex.java @@ -220,7 +220,7 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ } public static boolean isInRangeOfIndex(PlayerEntity player, TileCorporeaIndex index) { - return player.dimension == index.world.getDimension().getType() && MathHelper.pointDistancePlane(index.getPos().getX() + 0.5, index.getPos().getZ() + 0.5, player.posX, player.posZ) < RADIUS && Math.abs(index.getPos().getY() + 0.5 - player.posY + (player.world.isRemote ? 0 : 1.6)) < 5; + return player.dimension == index.world.getDimension().getType() && MathHelper.pointDistancePlane(index.getPos().getX() + 0.5, index.getPos().getZ() + 0.5, player.getX(), player.getZ()) < RADIUS && Math.abs(index.getPos().getY() + 0.5 - player.getY() + (player.world.isRemote ? 0 : 1.6)) < 5; } public static void addPattern(String pattern, IRegexStacker stacker) { diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TilePool.java b/src/main/java/vazkii/botania/common/block/tile/mana/TilePool.java index c00f22204..585f699ad 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TilePool.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TilePool.java @@ -388,7 +388,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt ((ServerPlayerEntity) player).connection.sendPacket(new SUpdateTileEntityPacket(pos, -999, nbttagcompound)); } - world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.ding, SoundCategory.PLAYERS, 0.11F, 1F); + world.playSound(null, player.getX(), player.getY(), player.getZ(), ModSounds.ding, SoundCategory.PLAYERS, 0.11F, 1F); } @OnlyIn(Dist.CLIENT) @@ -398,8 +398,8 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt int color = 0x4444FF; HUDHandler.drawSimpleManaHUD(color, knownMana, manaCap, name); - int x = Minecraft.getInstance().mainWindow.getScaledWidth() / 2 - 11; - int y = Minecraft.getInstance().mainWindow.getScaledHeight() / 2 + 30; + int x = Minecraft.getInstance().getWindow().getScaledWidth() / 2 - 11; + int y = Minecraft.getInstance().getWindow().getScaledHeight() / 2 + 30; int u = outputting ? 22 : 0; int v = 38; diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TileSpreader.java b/src/main/java/vazkii/botania/common/block/tile/mana/TileSpreader.java index 51cea793b..3917bd166 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TileSpreader.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TileSpreader.java @@ -391,7 +391,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, if(player instanceof ServerPlayerEntity) ((ServerPlayerEntity) player).connection.sendPacket(new SUpdateTileEntityPacket(pos, -999, nbttagcompound)); } - world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.ding, SoundCategory.PLAYERS, 0.1F, 1); + world.playSound(null, player.getX(), player.getY(), player.getZ(), ModSounds.ding, SoundCategory.PLAYERS, 0.1F, 1); } else { RayTraceResult pos = Item.rayTrace(world, player, RayTraceContext.FluidMode.ANY); if(pos instanceof BlockRayTraceResult && !world.isRemote) { @@ -559,8 +559,8 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); String lensName = lens.getDisplayName().getString(); int width = 16 + mc.fontRenderer.getStringWidth(lensName) / 2; - int x = mc.mainWindow.getScaledWidth() / 2 - width; - int y = mc.mainWindow.getScaledHeight() / 2 + 50; + int x = mc.getWindow().getScaledWidth() / 2 - width; + int y = mc.getWindow().getScaledHeight() / 2 + 50; mc.fontRenderer.drawStringWithShadow(lensName, x + 20, y + 5, color); RenderHelper.enableGUIStandardItemLighting(); @@ -578,8 +578,8 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, if(!recieverStack.isEmpty()) { String stackName = recieverStack.getDisplayName().getString(); int width = 16 + mc.fontRenderer.getStringWidth(stackName) / 2; - int x = mc.mainWindow.getScaledWidth() / 2 - width; - int y = mc.mainWindow.getScaledHeight() / 2 + 30; + int x = mc.getWindow().getScaledWidth() / 2 - width; + int y = mc.getWindow().getScaledHeight() / 2 + 30; mc.fontRenderer.drawStringWithShadow(stackName, x + 20, y + 5, color); RenderHelper.enableGUIStandardItemLighting(); @@ -791,9 +791,9 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector, if(getIdentifier().equals(expectedIdentity)) { pingbackTicks = TICKS_ALLOWED_WITHOUT_PINGBACK; Entity e = (Entity) burst; - lastPingbackX = e.posX; - lastPingbackY = e.posY; - lastPingbackZ = e.posZ; + lastPingbackX = e.getX(); + lastPingbackY = e.getY(); + lastPingbackZ = e.getZ(); setCanShoot(false); } } diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TileTurntable.java b/src/main/java/vazkii/botania/common/block/tile/mana/TileTurntable.java index bb6438558..885839321 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TileTurntable.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TileTurntable.java @@ -96,8 +96,8 @@ public class TileTurntable extends TileMod implements ITickableTileEntity { for(int i = 0; i < this.speed; i++) speed = speed + motion; - int x = mc.mainWindow.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(speed) / 2; - int y = mc.mainWindow.getScaledHeight() / 2 - 15; + int x = mc.getWindow().getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(speed) / 2; + int y = mc.getWindow().getScaledHeight() / 2 - 15; GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); mc.fontRenderer.drawStringWithShadow(speed, x, y, color); diff --git a/src/main/java/vazkii/botania/common/core/handler/PixieHandler.java b/src/main/java/vazkii/botania/common/core/handler/PixieHandler.java index 6dfc00e52..824d28d3e 100644 --- a/src/main/java/vazkii/botania/common/core/handler/PixieHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/PixieHandler.java @@ -49,7 +49,7 @@ public final class PixieHandler { if(Math.random() < chance) { EntityPixie pixie = new EntityPixie(player.world); - pixie.setPosition(player.posX, player.posY + 2, player.posZ); + pixie.setPosition(player.getX(), player.getY() + 2, player.getZ()); if(((ItemElementiumHelm) ModItems.elementiumHelm).hasArmorSet(player)) { pixie.setApplyPotionEffect(new EffectInstance(potions[event.getEntityLiving().world.rand.nextInt(potions.length)], 40, 0)); diff --git a/src/main/java/vazkii/botania/common/core/helper/Vector3.java b/src/main/java/vazkii/botania/common/core/helper/Vector3.java index 298320018..5e2cba65f 100644 --- a/src/main/java/vazkii/botania/common/core/helper/Vector3.java +++ b/src/main/java/vazkii/botania/common/core/helper/Vector3.java @@ -51,11 +51,11 @@ public class Vector3 } public static Vector3 fromEntity(Entity e) { - return new Vector3(e.posX, e.posY, e.posZ); + return new Vector3(e.getX(), e.getY(), e.getZ()); } public static Vector3 fromEntityCenter(Entity e) { - return new Vector3(e.posX, e.posY - e.getYOffset() + e.getHeight() / 2, e.posZ); + return new Vector3(e.getX(), e.getY() - e.getYOffset() + e.getHeight() / 2, e.getZ()); } public static Vector3 fromTileEntity(TileEntity e) { diff --git a/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java b/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java index 3e59e1b16..b31eea863 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java +++ b/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java @@ -61,7 +61,7 @@ import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TranslationTextComponent; import net.minecraft.world.BossInfo; import net.minecraft.world.Difficulty; -import net.minecraft.world.ServerBossInfo; +import net.minecraft.world.server.ServerBossInfo; import net.minecraft.world.World; import net.minecraft.world.server.ServerWorld; import net.minecraftforge.api.distmarker.Dist; @@ -427,7 +427,7 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti } playSound(SoundEvents.ENTITY_GENERIC_EXPLODE, 20F, (1F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F); - world.addParticle(ParticleTypes.EXPLOSION_EMITTER, posX, posY, posZ, 1D, 0D, 0D); + world.addParticle(ParticleTypes.EXPLOSION_EMITTER, getX(), getY(), getZ(), 1D, 0D, 0D); } @Override @@ -469,18 +469,13 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti continue; PlayerEntity saveLastAttacker = attackingPlayer; - double savePosX = posX; - double savePosY = posY; - double savePosZ = posZ; + Vec3d savePos = getPositionVec(); attackingPlayer = player; // Fake attacking player as the killer - posX = player.posX; // Spoof pos so drops spawn at the player - posY = player.posY; - posZ = player.posZ; + // Spoof pos so drops spawn at the player + setPosition(player.getX(), player.getY(), player.getZ()); super.dropLoot(DamageSource.causePlayerDamage(player), wasRecentlyHit); - posX = savePosX; - posY = savePosY; - posZ = savePosZ; + setPosition(savePos.getX(), savePos.getY(), savePos.getZ()); attackingPlayer = saveLastAttacker; } @@ -593,7 +588,7 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti } private void keepInsideArena(PlayerEntity player) { - if(vazkii.botania.common.core.helper.MathHelper.pointDistanceSpace(player.posX, player.posY, player.posZ, source.getX() + 0.5, source.getY() + 0.5, source.getZ() + 0.5) >= ARENA_RANGE) { + if(vazkii.botania.common.core.helper.MathHelper.pointDistanceSpace(player.getX(), player.getY(), player.getZ(), source.getX() + 0.5, source.getY() + 0.5, source.getZ() + 0.5) >= ARENA_RANGE) { Vector3 sourceVector = new Vector3(source.getX() + 0.5, source.getY() + 0.5, source.getZ() + 0.5); Vector3 playerVector = Vector3.fromEntityCenter(player); Vector3 motion = sourceVector.subtract(playerVector).normalize(); @@ -627,7 +622,7 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti for(int j = 0; j < 1 + world.rand.nextInt(hardMode ? 8 : 5); j++) { EntityPixie pixie = new EntityPixie(world); pixie.setProps(players.get(rand.nextInt(players.size())), this, 1, 8); - pixie.setPosition(posX + getWidth() / 2, posY + 2, posZ + getWidth() / 2); + pixie.setPosition(getX() + getWidth() / 2, getY() + 2, getZ() + getWidth() / 2); pixie.onInitialSpawn(world, world.getDifficultyForLocation(new BlockPos(pixie)), SpawnReason.MOB_SUMMONED, null, null); world.addEntity(pixie); @@ -641,8 +636,8 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti if(!entity.isImmuneToFire()) entity.addPotionEffect(new EffectInstance(Effects.FIRE_RESISTANCE, 600, 0)); float range = 6F; - entity.setPosition(posX + 0.5 + Math.random() * range - range / 2, posY - 1, - posZ + 0.5 + Math.random() * range - range / 2); + entity.setPosition(getX() + 0.5 + Math.random() * range - range / 2, getY() - 1, + getZ() + 0.5 + Math.random() * range - range / 2); entity.onInitialSpawn(world, world.getDifficultyForLocation(new BlockPos(entity)), SpawnReason.MOB_SUMMONED, null, null); if(entity instanceof WitherSkeletonEntity && hardMode) { @@ -676,7 +671,7 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti if(world.getDifficulty() == Difficulty.PEACEFUL) remove(); - smashBlocksAround(MathHelper.floor(posX), MathHelper.floor(posY), MathHelper.floor(posZ), 1); + smashBlocksAround(MathHelper.floor(getX()), MathHelper.floor(getY()), MathHelper.floor(getZ()), 1); List players = getPlayersAround(); @@ -692,7 +687,7 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti } //also see SleepingHandler - if(player.isSleeping()) player.wakeUpPlayer(true, true, false); + if(player.isSleeping()) player.wakeUp(true, true); clearPotions(player); keepInsideArena(player); @@ -752,7 +747,7 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti int count = dying && hardMode ? 7 : 6; for(int i = 0; i < count; i++) { int x = source.getX() - 10 + rand.nextInt(20); - int y = (int) players.get(rand.nextInt(players.size())).posY; + int y = (int) players.get(rand.nextInt(players.size())).getY(); int z = source.getZ() - 10 + rand.nextInt(20); EntityMagicLandmine landmine = new EntityMagicLandmine(world); @@ -767,7 +762,7 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti for(int i = 0; i < (spawnPixies ? world.rand.nextInt(hardMode ? 6 : 3) : 1); i++) { EntityPixie pixie = new EntityPixie(world); pixie.setProps(players.get(rand.nextInt(players.size())), this, 1, 8); - pixie.setPosition(posX + getWidth() / 2, posY + 2, posZ + getWidth() / 2); + pixie.setPosition(getX() + getWidth() / 2, getY() + 2, getZ() + getWidth() / 2); pixie.onInitialSpawn(world, world.getDifficultyForLocation(new BlockPos(pixie)), SpawnReason.MOB_SUMMONED, null, null); world.addEntity(pixie); @@ -817,7 +812,7 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti private void spawnMissile() { EntityMagicMissile missile = new EntityMagicMissile(this, true); - missile.setPosition(posX + (Math.random() - 0.5 * 0.1), posY + 2.4 + (Math.random() - 0.5 * 0.1), posZ + (Math.random() - 0.5 * 0.1)); + missile.setPosition(getX() + (Math.random() - 0.5 * 0.1), getY() + 2.4 + (Math.random() - 0.5 * 0.1), getZ() + (Math.random() - 0.5 * 0.1)); if(missile.findTarget()) { playSound(ModSounds.missile, 0.6F, 0.8F + (float) Math.random() * 0.2F); world.addEntity(missile); @@ -826,7 +821,7 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti private void teleportRandomly() { //choose a location to teleport to - double oldX = posX, oldY = posY, oldZ = posZ; + double oldX = getX(), oldY = getY(), oldZ = getZ(); double newX, newY = source.getY(), newZ; int tries = 0; @@ -937,7 +932,6 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti Minecraft mc = Minecraft.getInstance(); ItemStack stack = new ItemStack(Items.PLAYER_HEAD); mc.textureManager.bindTexture(AtlasTexture.LOCATION_BLOCKS_TEXTURE); - net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting(); GlStateManager.enableRescaleNormal(); mc.getItemRenderer().renderItemIntoGUI(stack, px, py); net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); @@ -967,19 +961,19 @@ public class EntityDoppleganger extends MobEntity implements IBotaniaBoss, IEnti public ShaderCallback getBossBarShaderCallback(boolean background, int shader) { if(shaderCallback == null) shaderCallback = shader1 -> { - int grainIntensityUniform = GLX.glGetUniformLocation(shader1, "grainIntensity"); - int hpFractUniform = GLX.glGetUniformLocation(shader1, "hpFract"); + int grainIntensityUniform = GlStateManager.getUniformLocation(shader1, "grainIntensity"); + int hpFractUniform = GlStateManager.getUniformLocation(shader1, "hpFract"); float time = getInvulTime(); float grainIntensity = time > 20 ? 1F : Math.max(hardMode ? 0.5F : 0F, time / 20F); ShaderHelper.FLOAT_BUF.position(0); ShaderHelper.FLOAT_BUF.put(0, grainIntensity); - GLX.glUniform1(grainIntensityUniform, ShaderHelper.FLOAT_BUF); + GlStateManager.uniform1(grainIntensityUniform, ShaderHelper.FLOAT_BUF); ShaderHelper.FLOAT_BUF.position(0); ShaderHelper.FLOAT_BUF.put(0, getHealth() / getMaxHealth()); - GLX.glUniform1(hpFractUniform, ShaderHelper.FLOAT_BUF); + GlStateManager.uniform1(hpFractUniform, ShaderHelper.FLOAT_BUF); }; return background ? null : shaderCallback; diff --git a/src/main/java/vazkii/botania/common/entity/EntityFlameRing.java b/src/main/java/vazkii/botania/common/entity/EntityFlameRing.java index 78320b3b4..e36ca7afa 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityFlameRing.java +++ b/src/main/java/vazkii/botania/common/entity/EntityFlameRing.java @@ -92,7 +92,7 @@ public class EntityFlameRing extends Entity { return; for(LivingEntity entity : entities) { - if(entity == null || MathHelper.pointDistancePlane(posX, posY, entity.posX, entity.posY) > radius) + if(entity == null || MathHelper.pointDistancePlane(posX, posY, entity.getX(), entity.getY()) > radius) continue; entity.setFire(4); diff --git a/src/main/java/vazkii/botania/common/entity/EntityMagicMissile.java b/src/main/java/vazkii/botania/common/entity/EntityMagicMissile.java index b72a721f4..c5782317d 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityMagicMissile.java +++ b/src/main/java/vazkii/botania/common/entity/EntityMagicMissile.java @@ -132,9 +132,9 @@ public class EntityMagicMissile extends ThrowableEntity { LivingEntity target = getTargetEntity(); if(target != null) { if(lockY == -1) { - lockX = target.posX; - lockY = target.posY; - lockZ = target.posZ; + lockX = target.getX(); + lockY = target.getY(); + lockZ = target.getZ(); } Vector3 targetVec = evil ? new Vector3(lockX, lockY, lockZ) : Vector3.fromEntityCenter(target); diff --git a/src/main/java/vazkii/botania/common/entity/EntityManaBurst.java b/src/main/java/vazkii/botania/common/entity/EntityManaBurst.java index dac330689..f5c5cc318 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityManaBurst.java +++ b/src/main/java/vazkii/botania/common/entity/EntityManaBurst.java @@ -162,9 +162,9 @@ public class EntityManaBurst extends ThrowableEntity implements IManaBurst { } private void superUpdate() { - this.lastTickPosX = this.posX; - this.lastTickPosY = this.posY; - this.lastTickPosZ = this.posZ; + this.lastTickPosX = this.getX(); + this.lastTickPosY = this.getY(); + this.lastTickPosZ = this.getZ(); // Botania - inline supersuperclass.tick() { if (!this.world.isRemote) { @@ -219,9 +219,9 @@ public class EntityManaBurst extends ThrowableEntity implements IManaBurst { } Vec3d vec3d = this.getMotion(); - this.posX += vec3d.x; - this.posY += vec3d.y; - this.posZ += vec3d.z; + this.getX() += vec3d.x; + this.getY() += vec3d.y; + this.getZ() += vec3d.z; float f = MathHelper.sqrt(horizontalMag(vec3d)); this.rotationYaw = (float)(MathHelper.atan2(vec3d.x, vec3d.z) * (double)(180F / (float)Math.PI)); @@ -247,7 +247,7 @@ public class EntityManaBurst extends ThrowableEntity implements IManaBurst { if (this.isInWater()) { for(int i = 0; i < 4; ++i) { float f2 = 0.25F; - this.world.addParticle(ParticleTypes.BUBBLE, this.posX - vec3d.x * 0.25D, this.posY - vec3d.y * 0.25D, this.posZ - vec3d.z * 0.25D, vec3d.x, vec3d.y, vec3d.z); + this.world.addParticle(ParticleTypes.BUBBLE, this.getX() - vec3d.x * 0.25D, this.getY() - vec3d.y * 0.25D, this.getZ() - vec3d.z * 0.25D, vec3d.x, vec3d.y, vec3d.z); } f1 = 0.8F; @@ -261,7 +261,7 @@ public class EntityManaBurst extends ThrowableEntity implements IManaBurst { this.setMotion(vec3d1.x, vec3d1.y - (double)this.getGravityVelocity(), vec3d1.z); } - this.setPosition(this.posX, this.posY, this.posZ); + this.setPosition(this.getX(), this.getY(), this.getZ()); } @Override @@ -793,9 +793,9 @@ public class EntityManaBurst extends ThrowableEntity implements IManaBurst { public boolean invalid = false; public PositionProperties(Entity entity) { - int x = MathHelper.floor(entity.posX); - int y = MathHelper.floor(entity.posY); - int z = MathHelper.floor(entity.posZ); + int x = MathHelper.floor(entity.getX()); + int y = MathHelper.floor(entity.getY()); + int z = MathHelper.floor(entity.getZ()); coords = new BlockPos(x, y, z); state = entity.world.getBlockState(coords); } diff --git a/src/main/java/vazkii/botania/common/entity/EntityManaStorm.java b/src/main/java/vazkii/botania/common/entity/EntityManaStorm.java index 3c45006b8..cbae49dbb 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityManaStorm.java +++ b/src/main/java/vazkii/botania/common/entity/EntityManaStorm.java @@ -67,14 +67,14 @@ public class EntityManaStorm extends Entity { deathTime++; if(deathTime >= DEATH_TIME) { remove(); - world.createExplosion(this, posX, posY, posZ, 8F, true, Explosion.Mode.DESTROY); + world.createExplosion(this, getX(), getY(), getZ(), 8F, true, Explosion.Mode.DESTROY); } } } private void spawnBurst() { EntityManaBurst burst = new EntityManaBurst(world); - burst.setPosition(posX, posY, posZ); + burst.setPosition(getX(), getY(), getZ()); float motionModifier = 0.5F; burst.setColor(0x20FF20); diff --git a/src/main/java/vazkii/botania/common/entity/EntityPinkWither.java b/src/main/java/vazkii/botania/common/entity/EntityPinkWither.java index 8595f660e..cb670b495 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityPinkWither.java +++ b/src/main/java/vazkii/botania/common/entity/EntityPinkWither.java @@ -82,25 +82,25 @@ public class EntityPinkWither extends WitherEntity { private double getHeadX(int p_82214_1_) { if (p_82214_1_ <= 0) { - return this.posX; + return this.getX(); } else { float f = (this.renderYawOffset + (float)(180 * (p_82214_1_ - 1))) * ((float)Math.PI / 180F); float f1 = MathHelper.cos(f); - return this.posX + (double)f1 * 1.3D; + return this.getX() + (double)f1 * 1.3D; } } private double getHeadY(int p_82208_1_) { - return p_82208_1_ <= 0 ? this.posY + 3.0D : this.posY + 2.2D; + return p_82208_1_ <= 0 ? this.getY() + 3.0D : this.getY() + 2.2D; } private double getHeadZ(int p_82213_1_) { if (p_82213_1_ <= 0) { - return this.posZ; + return this.getZ(); } else { float f = (this.renderYawOffset + (float)(180 * (p_82213_1_ - 1))) * ((float)Math.PI / 180F); float f1 = MathHelper.sin(f); - return this.posZ + (double)f1 * 1.3D; + return this.getZ() + (double)f1 * 1.3D; } } diff --git a/src/main/java/vazkii/botania/common/entity/EntityPixie.java b/src/main/java/vazkii/botania/common/entity/EntityPixie.java index 99f23dc57..e6b8c0a39 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityPixie.java +++ b/src/main/java/vazkii/botania/common/entity/EntityPixie.java @@ -87,9 +87,9 @@ public class EntityPixie extends FlyingEntity { protected void updateAITasks() { LivingEntity target = getAttackTarget(); if(target != null) { - double d0 = target.posX + target.getWidth() / 2 - posX; - double d1 = target.posY + target.getHeight() / 2 - posY; - double d2 = target.posZ + target.getWidth() / 2 - posZ; + double d0 = target.getX() + target.getWidth() / 2 - posX; + double d1 = target.getY() + target.getHeight() / 2 - posY; + double d2 = target.getZ() + target.getWidth() / 2 - posZ; double d3 = d0 * d0 + d1 * d1 + d2 * d2; float mod = 0.45F; diff --git a/src/main/java/vazkii/botania/common/entity/EntityPoolMinecart.java b/src/main/java/vazkii/botania/common/entity/EntityPoolMinecart.java index 869a11094..40c74511f 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityPoolMinecart.java +++ b/src/main/java/vazkii/botania/common/entity/EntityPoolMinecart.java @@ -123,9 +123,9 @@ public class EntityPoolMinecart extends AbstractMinecartEntity { if(world.isRemote) { double particleChance = 1F - (double) getMana() / (double) TilePool.MAX_MANA * 0.1; Color color = TilePool.PARTICLE_COLOR; - double x = MathHelper.floor(posX); - double y = MathHelper.floor(posY); - double z = MathHelper.floor(posZ); + double x = MathHelper.floor(getX()); + double y = MathHelper.floor(getY()); + double z = MathHelper.floor(getZ()); if(Math.random() > particleChance) { WispParticleData data = WispParticleData.wisp((float) Math.random() / 3F, (float) color.getRed(), color.getGreen() / 255F, color.getBlue() / 255F, 2F); world.addParticle(data, x + 0.3 + Math.random() * 0.5, y + 0.85 + Math.random() * 0.25, z + Math.random(), 0, (float) Math.random() / 25F, 0); diff --git a/src/main/java/vazkii/botania/common/entity/EntitySpark.java b/src/main/java/vazkii/botania/common/entity/EntitySpark.java index 0d44f887e..023c6cc1c 100644 --- a/src/main/java/vazkii/botania/common/entity/EntitySpark.java +++ b/src/main/java/vazkii/botania/common/entity/EntitySpark.java @@ -223,7 +223,7 @@ public class EntitySpark extends EntitySparkBase implements ISparkEntity { public static void particleBeam(PlayerEntity player, Entity e1, Entity e2) { if(e1 != null && e2 != null && !e1.world.isRemote) { PacketHandler.sendTo((ServerPlayerEntity) player, - new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.SPARK_NET_INDICATOR, e1.posX, e1.posY, e1.posZ, + new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.SPARK_NET_INDICATOR, e1.getX(), e1.getY(), e1.getZ(), e1.getEntityId(), e2.getEntityId())); } } diff --git a/src/main/java/vazkii/botania/common/entity/EntityThrowableCopy.java b/src/main/java/vazkii/botania/common/entity/EntityThrowableCopy.java index 1583e4813..acd468ace 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityThrowableCopy.java +++ b/src/main/java/vazkii/botania/common/entity/EntityThrowableCopy.java @@ -46,7 +46,7 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile } protected EntityThrowableCopy(EntityType type, LivingEntity livingEntityIn, World worldIn) { - this(type, livingEntityIn.posX, livingEntityIn.posY + (double)livingEntityIn.getEyeHeight() - (double)0.1F, livingEntityIn.posZ, worldIn); + this(type, livingEntityIn.getX(), livingEntityIn.getY() + (double)livingEntityIn.getEyeHeight() - (double)0.1F, livingEntityIn.getZ(), worldIn); this.owner = livingEntityIn; this.ownerId = livingEntityIn.getUniqueID(); } @@ -110,9 +110,9 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile * Called to update the entity's position/logic. */ public void tick() { - this.lastTickPosX = this.posX; - this.lastTickPosY = this.posY; - this.lastTickPosZ = this.posZ; + this.lastTickPosX = this.getX(); + this.lastTickPosY = this.getY(); + this.lastTickPosZ = this.getZ(); super.tick(); if (this.throwableShake > 0) { --this.throwableShake; @@ -156,9 +156,9 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile } Vec3d vec3d = this.getMotion(); - this.posX += vec3d.x; - this.posY += vec3d.y; - this.posZ += vec3d.z; + this.getX() += vec3d.x; + this.getY() += vec3d.y; + this.getZ() += vec3d.z; float f = MathHelper.sqrt(horizontalMag(vec3d)); this.rotationYaw = (float)(MathHelper.atan2(vec3d.x, vec3d.z) * (double)(180F / (float)Math.PI)); @@ -184,7 +184,7 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile if (this.isInWater()) { for(int i = 0; i < 4; ++i) { float f2 = 0.25F; - this.world.addParticle(ParticleTypes.BUBBLE, this.posX - vec3d.x * 0.25D, this.posY - vec3d.y * 0.25D, this.posZ - vec3d.z * 0.25D, vec3d.x, vec3d.y, vec3d.z); + this.world.addParticle(ParticleTypes.BUBBLE, this.getX() - vec3d.x * 0.25D, this.getY() - vec3d.y * 0.25D, this.getZ() - vec3d.z * 0.25D, vec3d.x, vec3d.y, vec3d.z); } f1 = 0.8F; @@ -198,7 +198,7 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile this.setMotion(vec3d1.x, vec3d1.y - (double)this.getGravityVelocity(), vec3d1.z); } - this.setPosition(this.posX, this.posY, this.posZ); + this.setPosition(this.getX(), this.getY(), this.getZ()); } /** diff --git a/src/main/java/vazkii/botania/common/integration/curios/CurioIntegration.java b/src/main/java/vazkii/botania/common/integration/curios/CurioIntegration.java index c909a6338..cb0147345 100644 --- a/src/main/java/vazkii/botania/common/integration/curios/CurioIntegration.java +++ b/src/main/java/vazkii/botania/common/integration/curios/CurioIntegration.java @@ -116,7 +116,7 @@ public class CurioIntegration extends EquipmentHandler { @Override public void playEquipSound(LivingEntity entity) { - entity.world.playSound(null, entity.posX, entity.posY, entity.posZ, ModSounds.equipBauble, entity.getSoundCategory(), 0.1F, 1.3F); + entity.world.playSound(null, entity.getX(), entity.getY(), entity.getZ(), ModSounds.equipBauble, entity.getSoundCategory(), 0.1F, 1.3F); } @Override diff --git a/src/main/java/vazkii/botania/common/item/ItemAstrolabe.java b/src/main/java/vazkii/botania/common/item/ItemAstrolabe.java index b3d241c5c..329014d76 100644 --- a/src/main/java/vazkii/botania/common/item/ItemAstrolabe.java +++ b/src/main/java/vazkii/botania/common/item/ItemAstrolabe.java @@ -90,10 +90,10 @@ public class ItemAstrolabe extends ItemMod { ItemsRemainingRenderHandler.set(stack, newSize + "x" + newSize); worldIn.playSound(playerIn, playerIn.getPosition(), SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, SoundCategory.PLAYERS, 0.5F, 1F); - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + return ActionResult.success(stack); } - return ActionResult.newResult(ActionResultType.PASS, stack); + return ActionResult.pass(stack); } public boolean placeAllBlocks(ItemStack stack, PlayerEntity player) { diff --git a/src/main/java/vazkii/botania/common/item/ItemBaubleBox.java b/src/main/java/vazkii/botania/common/item/ItemBaubleBox.java index 7493c496f..e3506089e 100644 --- a/src/main/java/vazkii/botania/common/item/ItemBaubleBox.java +++ b/src/main/java/vazkii/botania/common/item/ItemBaubleBox.java @@ -93,6 +93,6 @@ public class ItemBaubleBox extends ItemMod { b.writeBoolean(hand == Hand.MAIN_HAND); }); } - return ActionResult.newResult(ActionResultType.SUCCESS, player.getHeldItem(hand)); + return ActionResult.success(player.getHeldItem(hand)); } } diff --git a/src/main/java/vazkii/botania/common/item/ItemBlackHoleTalisman.java b/src/main/java/vazkii/botania/common/item/ItemBlackHoleTalisman.java index b796530ec..976abd4fa 100644 --- a/src/main/java/vazkii/botania/common/item/ItemBlackHoleTalisman.java +++ b/src/main/java/vazkii/botania/common/item/ItemBlackHoleTalisman.java @@ -64,10 +64,10 @@ public class ItemBlackHoleTalisman extends ItemMod implements IBlockProvider { if(getBlock(stack) != null && player.isSneaking()) { ItemNBTHelper.setBoolean(stack, TAG_ACTIVE, !ItemNBTHelper.getBoolean(stack, TAG_ACTIVE, false)); player.playSound(SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, 0.3F, 0.1F); - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + return ActionResult.success(stack); } - return ActionResult.newResult(ActionResultType.PASS, stack); + return ActionResult.pass(stack); } @Nonnull diff --git a/src/main/java/vazkii/botania/common/item/ItemBlackLotus.java b/src/main/java/vazkii/botania/common/item/ItemBlackLotus.java index 387734638..49032a4e3 100644 --- a/src/main/java/vazkii/botania/common/item/ItemBlackLotus.java +++ b/src/main/java/vazkii/botania/common/item/ItemBlackLotus.java @@ -55,7 +55,7 @@ public class ItemBlackLotus extends ItemMod implements IManaDissolvable { pool.recieveMana(t2 ? MANA_PER_T2 : MANA_PER); stack.shrink(1); VanillaPacketDispatcher.dispatchTEToNearbyPlayers(item.world, tile.getPos()); - PacketHandler.sendToNearby(item.world, item, new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.BLACK_LOTUS_DISSOLVE, item.posX, tile.getPos().getY() + 0.5, item.posZ)); + PacketHandler.sendToNearby(item.world, item, new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.BLACK_LOTUS_DISSOLVE, item.getX(), tile.getPos().getY() + 0.5, item.getZ())); } item.playSound(ModSounds.blackLotus, 0.5F, t2 ? 0.1F : 1F); diff --git a/src/main/java/vazkii/botania/common/item/ItemBottledMana.java b/src/main/java/vazkii/botania/common/item/ItemBottledMana.java index cc10e5715..07a8becf1 100644 --- a/src/main/java/vazkii/botania/common/item/ItemBottledMana.java +++ b/src/main/java/vazkii/botania/common/item/ItemBottledMana.java @@ -75,8 +75,8 @@ public class ItemBottledMana extends ItemMod { } case 3 : { // Mini Explosion if(!living.world.isRemote) - living.world.createExplosion(null, living.posX, living.posY, - living.posZ, 0.25F, Explosion.Mode.NONE); + living.world.createExplosion(null, living.getX(), living.getY(), + living.getZ(), 0.25F, Explosion.Mode.NONE); break; } case 4 : { // Mega Jump @@ -120,14 +120,14 @@ public class ItemBottledMana extends ItemMod { break; } case 9 : { // Highest Possible - int x = MathHelper.floor(living.posX); - int z = MathHelper.floor(living.posZ); + int x = MathHelper.floor(living.getX()); + int z = MathHelper.floor(living.getZ()); for(int i = 256; i > 0; i--) { Block block = living.world.getBlockState(new BlockPos(x, i, z)).getBlock(); if(!block.isAir(living.world.getBlockState(new BlockPos(x, i, z)), living.world, new BlockPos(x, i, z))) { if(living instanceof ServerPlayerEntity) { ServerPlayerEntity mp = (ServerPlayerEntity) living; - mp.connection.setPlayerLocation(living.posX, i, living.posZ, living.rotationYaw, living.rotationPitch); + mp.connection.setPlayerLocation(living.getX(), i, living.getZ(), living.rotationYaw, living.rotationPitch); } break; } @@ -148,14 +148,14 @@ public class ItemBottledMana extends ItemMod { case 12 : { // Flare if(!living.world.isRemote) { EntitySignalFlare flare = new EntitySignalFlare(living.world); - flare.setPosition(living.posX, living.posY, living.posZ); + flare.setPosition(living.getX(), living.getY(), living.getZ()); flare.setColor(living.world.rand.nextInt(16)); flare.playSound(SoundEvents.ENTITY_GENERIC_EXPLODE, 40F, (1.0F + (living.world.rand.nextFloat() - living.world.rand.nextFloat()) * 0.2F) * 0.7F); living.world.addEntity(flare); int range = 5; - List entities = living.world.getEntitiesWithinAABB(LivingEntity.class, new AxisAlignedBB(living.posX - range, living.posY - range, living.posZ - range, living.posX + range, living.posY + range, living.posZ + range)); + List entities = living.world.getEntitiesWithinAABB(LivingEntity.class, new AxisAlignedBB(living.getX() - range, living.getY() - range, living.getZ() - range, living.getX() + range, living.getY() + range, living.getZ() + range)); for(LivingEntity entity : entities) if(entity != living && (!(entity instanceof PlayerEntity) || ServerLifecycleHooks.getCurrentServer() == null || ServerLifecycleHooks.getCurrentServer().isPVPEnabled())) entity.addPotionEffect(new EffectInstance(Effects.SLOWNESS, 50, 5)); @@ -166,7 +166,7 @@ public class ItemBottledMana extends ItemMod { case 13 : { // Pixie Friend if(!living.world.isRemote) { EntityPixie pixie = new EntityPixie(living.world); - pixie.setPosition(living.posX, living.posY + 1.5, living.posZ); + pixie.setPosition(living.getX(), living.getY() + 1.5, living.getZ()); living.world.addEntity(pixie); } break; @@ -218,7 +218,7 @@ public class ItemBottledMana extends ItemMod { @Override public ActionResult onItemRightClick(World world, PlayerEntity player, @Nonnull Hand hand) { player.setActiveHand(hand); - return ActionResult.newResult(ActionResultType.SUCCESS, player.getHeldItem(hand)); + return ActionResult.success(player.getHeldItem(hand)); } @Nonnull diff --git a/src/main/java/vazkii/botania/common/item/ItemCacophonium.java b/src/main/java/vazkii/botania/common/item/ItemCacophonium.java index 7c74296a1..47a0cf420 100644 --- a/src/main/java/vazkii/botania/common/item/ItemCacophonium.java +++ b/src/main/java/vazkii/botania/common/item/ItemCacophonium.java @@ -132,13 +132,13 @@ public class ItemCacophonium extends ItemMod { ItemStack stack = player.getHeldItem(hand); if(getSound(stack) != null) player.setActiveHand(hand); - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + return ActionResult.success(stack); } @Override public void onUsingTick(ItemStack stack, LivingEntity player, int count) { if(count % (isDOIT(stack) ? 20 : 6) == 0) - playSound(player.world, stack, player.posX, player.posY, player.posZ, SoundCategory.PLAYERS, 0.9F); + playSound(player.world, stack, player.getX(), player.getY(), player.getZ(), SoundCategory.PLAYERS, 0.9F); } public static void playSound(World world, ItemStack stack, double x, double y, double z, SoundCategory category, float volume) { diff --git a/src/main/java/vazkii/botania/common/item/ItemCraftingHalo.java b/src/main/java/vazkii/botania/common/item/ItemCraftingHalo.java index ad87b9fc6..7f3a9a34a 100644 --- a/src/main/java/vazkii/botania/common/item/ItemCraftingHalo.java +++ b/src/main/java/vazkii/botania/common/item/ItemCraftingHalo.java @@ -108,7 +108,7 @@ public class ItemCraftingHalo extends ItemMod { } - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + return ActionResult.success(stack); } public static IItemHandler getFakeInv(PlayerEntity player) { @@ -417,9 +417,9 @@ public class ItemCraftingHalo extends ItemMod { GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); float alpha = ((float) Math.sin((ClientTickHandler.ticksInGame + partialTicks) * 0.2F) * 0.5F + 0.5F) * 0.4F + 0.3F; - double posX = player.prevPosX + (player.posX - player.prevPosX) * partialTicks; - double posY = player.prevPosY + (player.posY - player.prevPosY) * partialTicks; - double posZ = player.prevPosZ + (player.posZ - player.prevPosZ) * partialTicks; + double posX = player.prevPosX + (player.getX() - player.prevPosX) * partialTicks; + double posY = player.prevPosY + (player.getY() - player.prevPosY) * partialTicks; + double posZ = player.prevPosZ + (player.getZ() - player.prevPosZ) * partialTicks; GlStateManager.translated(posX - renderPosX, posY - renderPosY + player.getEyeHeight(), posZ - renderPosZ); @@ -520,14 +520,14 @@ public class ItemCraftingHalo extends ItemMod { if(slot == 0) { String name = craftingTable.getDisplayName().getString(); int l = mc.fontRenderer.getStringWidth(name); - int x = mc.mainWindow.getScaledWidth() / 2 - l / 2; - int y = mc.mainWindow.getScaledHeight() / 2 - 65; + int x = mc.getWindow().getScaledWidth() / 2 - l / 2; + int y = mc.getWindow().getScaledHeight() / 2 - 65; AbstractGui.fill(x - 6, y - 6, x + l + 6, y + 37, 0x22000000); AbstractGui.fill(x - 4, y - 4, x + l + 4, y + 35, 0x22000000); net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting(); GlStateManager.enableRescaleNormal(); - mc.getItemRenderer().renderItemAndEffectIntoGUI(craftingTable, mc.mainWindow.getScaledWidth() / 2 - 8, mc.mainWindow.getScaledHeight() / 2 - 52); + mc.getItemRenderer().renderItemAndEffectIntoGUI(craftingTable, mc.getWindow().getScaledWidth() / 2 - 8, mc.getWindow().getScaledHeight() / 2 - 52); net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting(); mc.fontRenderer.drawStringWithShadow(name, x, y, 0xFFFFFF); @@ -552,8 +552,8 @@ public class ItemCraftingHalo extends ItemMod { Minecraft mc = Minecraft.getInstance(); if(!recipe[9].isEmpty()) { - int x = mc.mainWindow.getScaledWidth() / 2 - 45; - int y = mc.mainWindow.getScaledHeight() / 2 - 90; + int x = mc.getWindow().getScaledWidth() / 2 - 45; + int y = mc.getWindow().getScaledHeight() / 2 - 90; AbstractGui.fill(x - 6, y - 6, x + 90 + 6, y + 60, 0x22000000); AbstractGui.fill(x - 4, y - 4, x + 90 + 4, y + 58, 0x22000000); @@ -583,10 +583,10 @@ public class ItemCraftingHalo extends ItemMod { int yoff = 110; if(setRecipe && !canCraft(recipe, getFakeInv(player))) { String warning = TextFormatting.RED + I18n.format("botaniamisc.cantCraft"); - mc.fontRenderer.drawStringWithShadow(warning, mc.mainWindow.getScaledWidth() / 2.0F - mc.fontRenderer.getStringWidth(warning) / 2.0F, mc.mainWindow.getScaledHeight() / 2.0F - yoff, 0xFFFFFF); + mc.fontRenderer.drawStringWithShadow(warning, mc.getWindow().getScaledWidth() / 2.0F - mc.fontRenderer.getStringWidth(warning) / 2.0F, mc.getWindow().getScaledHeight() / 2.0F - yoff, 0xFFFFFF); yoff += 12; } - mc.fontRenderer.drawStringWithShadow(label.getFormattedText(), mc.mainWindow.getScaledWidth() / 2.0F - mc.fontRenderer.getStringWidth(label.getString()) / 2.0F, mc.mainWindow.getScaledHeight() / 2.0F - yoff, 0xFFFFFF); + mc.fontRenderer.drawStringWithShadow(label.getFormattedText(), mc.getWindow().getScaledWidth() / 2.0F - mc.fontRenderer.getStringWidth(label.getString()) / 2.0F, mc.getWindow().getScaledHeight() / 2.0F - yoff, 0xFFFFFF); } } diff --git a/src/main/java/vazkii/botania/common/item/ItemEnderHand.java b/src/main/java/vazkii/botania/common/item/ItemEnderHand.java index 1318158c1..cc4406866 100644 --- a/src/main/java/vazkii/botania/common/item/ItemEnderHand.java +++ b/src/main/java/vazkii/botania/common/item/ItemEnderHand.java @@ -53,9 +53,9 @@ public class ItemEnderHand extends ItemMod implements IManaUsingItem, IBlockProv ManaItemHandler.requestManaExact(stack, player, COST_SELF, true); } player.playSound(SoundEvents.BLOCK_ENDER_CHEST_OPEN, 1F, 1F); - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + return ActionResult.success(stack); } - return ActionResult.newResult(ActionResultType.PASS, stack); + return ActionResult.pass(stack); } @Override diff --git a/src/main/java/vazkii/botania/common/item/ItemFlowerBag.java b/src/main/java/vazkii/botania/common/item/ItemFlowerBag.java index 91b607949..65e07ec45 100644 --- a/src/main/java/vazkii/botania/common/item/ItemFlowerBag.java +++ b/src/main/java/vazkii/botania/common/item/ItemFlowerBag.java @@ -112,7 +112,7 @@ public class ItemFlowerBag extends ItemMod { if(numPickedUp > 0) { event.setCanceled(true); if (!event.getItem().isSilent()) { - event.getItem().world.playSound(null, event.getEntityPlayer().posX, event.getEntityPlayer().posY, event.getEntityPlayer().posZ, + event.getItem().world.playSound(null, event.getEntityPlayer().getX(), event.getEntityPlayer().getY(), event.getEntityPlayer().getZ(), SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.PLAYERS, 0.2F, ((event.getItem().world.rand.nextFloat() - event.getItem().world.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); } @@ -136,7 +136,7 @@ public class ItemFlowerBag extends ItemMod { buf.writeBoolean(hand == Hand.MAIN_HAND); }); } - return ActionResult.newResult(ActionResultType.SUCCESS, player.getHeldItem(hand)); + return ActionResult.success(player.getHeldItem(hand)); } @Nonnull diff --git a/src/main/java/vazkii/botania/common/item/ItemHorn.java b/src/main/java/vazkii/botania/common/item/ItemHorn.java index d8e133ca4..00f6b0736 100644 --- a/src/main/java/vazkii/botania/common/item/ItemHorn.java +++ b/src/main/java/vazkii/botania/common/item/ItemHorn.java @@ -60,7 +60,7 @@ public class ItemHorn extends ItemMod { @Override public ActionResult onItemRightClick(World world, PlayerEntity player, @Nonnull Hand hand) { player.setActiveHand(hand); - return ActionResult.newResult(ActionResultType.SUCCESS, player.getHeldItem(hand)); + return ActionResult.success(player.getHeldItem(hand)); } @Override @@ -68,7 +68,7 @@ public class ItemHorn extends ItemMod { if(!player.world.isRemote) { if(time != getUseDuration(stack) && time % 5 == 0) breakGrass(player.world, stack, new BlockPos(player)); - player.world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.BLOCK_NOTE_BLOCK_BASS, SoundCategory.BLOCKS, 1F, 0.001F); + player.world.playSound(null, player.getX(), player.getY(), player.getZ(), SoundEvents.BLOCK_NOTE_BLOCK_BASS, SoundCategory.BLOCKS, 1F, 0.001F); } } diff --git a/src/main/java/vazkii/botania/common/item/ItemLaputaShard.java b/src/main/java/vazkii/botania/common/item/ItemLaputaShard.java index a87eb0286..048531f79 100644 --- a/src/main/java/vazkii/botania/common/item/ItemLaputaShard.java +++ b/src/main/java/vazkii/botania/common/item/ItemLaputaShard.java @@ -199,9 +199,9 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet public EntityManaBurst getBurst(World world, BlockPos pos, ItemStack stack) { EntityManaBurst burst = new EntityManaBurst(world); - burst.posX = pos.getX() + 0.5; - burst.posY = pos.getY() + 0.5; - burst.posZ = pos.getZ() + 0.5; + burst.getX() = pos.getX() + 0.5; + burst.getY() = pos.getY() + 0.5; + burst.getZ() = pos.getZ() + 0.5; burst.setColor(0x00EAFF); burst.setMana(1); @@ -244,9 +244,9 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet if(y != -1) spawnBurst(entity.world, new BlockPos(x, y, z), lens); } else if(burst.getTicksExisted() == placeTicks) { - int x = net.minecraft.util.math.MathHelper.floor(entity.posX); + int x = net.minecraft.util.math.MathHelper.floor(entity.getX()); int y = ItemNBTHelper.getInt(lens, TAG_Y_START, -1) + targetDistance; - int z = net.minecraft.util.math.MathHelper.floor(entity.posZ); + int z = net.minecraft.util.math.MathHelper.floor(entity.getZ()); BlockPos pos = new BlockPos(x, y, z); if(entity.world.isAirBlock(pos)) { @@ -278,7 +278,7 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet ThrowableEntity entity = (ThrowableEntity) burst; ItemStack lens = burst.getSourceLens(); BlockState state = NBTUtil.readBlockState(lens.getOrCreateTag().getCompound(TAG_STATE)); - entity.world.addParticle(new BlockParticleData(ParticleTypes.BLOCK, state), entity.posX, entity.posY, entity.posZ, + entity.world.addParticle(new BlockParticleData(ParticleTypes.BLOCK, state), entity.getX(), entity.getY(), entity.getZ(), entity.getMotion().getX(), entity.getMotion().getY(), entity.getMotion().getZ()); return true; diff --git a/src/main/java/vazkii/botania/common/item/ItemLexicon.java b/src/main/java/vazkii/botania/common/item/ItemLexicon.java index df5bd45c4..df9663ea6 100644 --- a/src/main/java/vazkii/botania/common/item/ItemLexicon.java +++ b/src/main/java/vazkii/botania/common/item/ItemLexicon.java @@ -89,10 +89,10 @@ public class ItemLexicon extends ItemMod implements IElvenItem { if(playerIn instanceof ServerPlayerEntity) { ServerPlayerEntity player= (ServerPlayerEntity) playerIn; - UseItemSuccessTrigger.INSTANCE.trigger(player, stack, player.getServerWorld(), player.posX, player.posY, player.posZ); + UseItemSuccessTrigger.INSTANCE.trigger(player, stack, player.getServerWorld(), player.getX(), player.getY(), player.getZ()); NetworkHandler.sendToPlayer(new MessageOpenBookGui(book.resourceLoc.toString()), (ServerPlayerEntity) playerIn); SoundEvent sfx = PatchouliSounds.getSound(book.openSound, PatchouliSounds.book_open); - worldIn.playSound(null, playerIn.posX, playerIn.posY, playerIn.posZ, sfx, SoundCategory.PLAYERS, 1F, (float) (0.7 + Math.random() * 0.4)); + worldIn.playSound(null, playerIn.getX(), playerIn.getY(), playerIn.getZ(), sfx, SoundCategory.PLAYERS, 1F, (float) (0.7 + Math.random() * 0.4)); } return new ActionResult<>(ActionResultType.SUCCESS, stack); diff --git a/src/main/java/vazkii/botania/common/item/ItemManaGun.java b/src/main/java/vazkii/botania/common/item/ItemManaGun.java index 06ebd728a..ad03693e5 100644 --- a/src/main/java/vazkii/botania/common/item/ItemManaGun.java +++ b/src/main/java/vazkii/botania/common/item/ItemManaGun.java @@ -77,31 +77,31 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem { if(player.isSneaking() && hasClip(stack)) { rotatePos(stack); - world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.PLAYERS, 0.6F, (1.0F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F); + world.playSound(null, player.getX(), player.getY(), player.getZ(), SoundEvents.BLOCK_STONE_BUTTON_CLICK_ON, SoundCategory.PLAYERS, 0.6F, (1.0F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F); if(world.isRemote) player.swingArm(hand); ItemStack lens = getLens(stack); ItemsRemainingRenderHandler.set(lens, -2); stack.setDamage(effCd); - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + return ActionResult.success(stack); } else if(stack.getDamage() == 0) { EntityManaBurst burst = getBurst(player, stack, true, hand); if(burst != null && ManaItemHandler.requestManaExact(stack, player, burst.getMana(), true)) { if(!world.isRemote) { - world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.manaBlaster, SoundCategory.PLAYERS, 0.6F, 1); + world.playSound(null, player.getX(), player.getY(), player.getZ(), ModSounds.manaBlaster, SoundCategory.PLAYERS, 0.6F, 1); world.addEntity(burst); - UseItemSuccessTrigger.INSTANCE.trigger((ServerPlayerEntity) player, stack, (ServerWorld) world, player.posX, player.posY, player.posZ); + UseItemSuccessTrigger.INSTANCE.trigger((ServerPlayerEntity) player, stack, (ServerWorld) world, player.getX(), player.getY(), player.getZ()); } else { player.swingArm(hand); player.setMotion(player.getMotion().subtract(burst.getMotion().mul(0.1, 0.3, 0.1))); } stack.setDamage(effCd); } else if(!world.isRemote) - world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.BLOCK_LEVER_CLICK, SoundCategory.PLAYERS, 0.6F, (1.0F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F); - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + world.playSound(null, player.getX(), player.getY(), player.getZ(), SoundEvents.BLOCK_LEVER_CLICK, SoundCategory.PLAYERS, 0.6F, (1.0F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F); + return ActionResult.success(stack); } - return ActionResult.newResult(ActionResultType.PASS, stack); + return ActionResult.pass(stack); } // ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN diff --git a/src/main/java/vazkii/botania/common/item/ItemManaMirror.java b/src/main/java/vazkii/botania/common/item/ItemManaMirror.java index 06db325c5..7273c2bcc 100644 --- a/src/main/java/vazkii/botania/common/item/ItemManaMirror.java +++ b/src/main/java/vazkii/botania/common/item/ItemManaMirror.java @@ -87,7 +87,7 @@ public class ItemManaMirror extends ItemMod implements IManaItem, ICoordBoundIte TileEntity tile = world.getTileEntity(ctx.getPos()); if(tile instanceof IManaPool) { bindPool(ctx.getItem(), tile); - world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.ding, SoundCategory.PLAYERS, 1F, 1F); + world.playSound(null, player.getX(), player.getY(), player.getZ(), ModSounds.ding, SoundCategory.PLAYERS, 1F, 1F); return ActionResultType.SUCCESS; } } diff --git a/src/main/java/vazkii/botania/common/item/ItemPinkinator.java b/src/main/java/vazkii/botania/common/item/ItemPinkinator.java index b0f965e3c..b911c9d4d 100644 --- a/src/main/java/vazkii/botania/common/item/ItemPinkinator.java +++ b/src/main/java/vazkii/botania/common/item/ItemPinkinator.java @@ -46,12 +46,12 @@ public class ItemPinkinator extends ItemMod { public ActionResult onItemRightClick(World world, PlayerEntity player, @Nonnull Hand hand) { ItemStack stack = player.getHeldItem(hand); int range = 16; - List withers = world.getEntitiesWithinAABB(WitherEntity.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range)); + List withers = world.getEntitiesWithinAABB(WitherEntity.class, new AxisAlignedBB(player.getX() - range, player.getY() - range, player.getZ() - range, player.getX() + range, player.getY() + range, player.getZ() + range)); for(WitherEntity wither : withers) if(!world.isRemote && wither.isAlive() && !(wither instanceof EntityPinkWither)) { wither.remove(); EntityPinkWither pink = new EntityPinkWither(world); - pink.setLocationAndAngles(wither.posX, wither.posY, wither.posZ, wither.rotationYaw, wither.rotationPitch); + pink.setLocationAndAngles(wither.getX(), wither.getY(), wither.getZ(), wither.rotationYaw, wither.rotationPitch); pink.setNoAI(wither.isAIDisabled()); if (wither.hasCustomName()) { pink.setCustomName(wither.getCustomName()); @@ -61,12 +61,12 @@ public class ItemPinkinator extends ItemMod { world.addEntity(pink); pink.spawnExplosionParticle(); pink.playSound(SoundEvents.ENTITY_GENERIC_EXPLODE, 4F, (1F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F); - UseItemSuccessTrigger.INSTANCE.trigger((ServerPlayerEntity) player, stack, (ServerWorld) world, player.posX, player.posY, player.posZ); + UseItemSuccessTrigger.INSTANCE.trigger((ServerPlayerEntity) player, stack, (ServerWorld) world, player.getX(), player.getY(), player.getZ()); stack.shrink(1); - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + return ActionResult.success(stack); } - return ActionResult.newResult(ActionResultType.PASS, stack); + return ActionResult.pass(stack); } @OnlyIn(Dist.CLIENT) diff --git a/src/main/java/vazkii/botania/common/item/ItemSextant.java b/src/main/java/vazkii/botania/common/item/ItemSextant.java index 1f6b611f8..5b505074d 100644 --- a/src/main/java/vazkii/botania/common/item/ItemSextant.java +++ b/src/main/java/vazkii/botania/common/item/ItemSextant.java @@ -149,7 +149,7 @@ public class ItemSextant extends ItemMod { reset(world, stack); } - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + return ActionResult.success(stack); } private static double calculateRadius(ItemStack stack, PlayerEntity player) { @@ -181,8 +181,8 @@ public class ItemSextant extends ItemMod { if(onUse == stack && stack.getItem().getUseDuration(stack) - time >= 10) { double radius = calculateRadius(stack, player); FontRenderer font = Minecraft.getInstance().fontRenderer; - int x = Minecraft.getInstance().mainWindow.getScaledWidth() / 2 + 30; - int y = Minecraft.getInstance().mainWindow.getScaledHeight() / 2; + int x = Minecraft.getInstance().getWindow().getScaledWidth() / 2 + 30; + int y = Minecraft.getInstance().getWindow().getScaledHeight() / 2; String s = Integer.toString((int) radius); boolean inRange = 0 < radius && radius <= MAX_RADIUS; diff --git a/src/main/java/vazkii/botania/common/item/ItemSlingshot.java b/src/main/java/vazkii/botania/common/item/ItemSlingshot.java index c13a4f507..2efbbe42c 100644 --- a/src/main/java/vazkii/botania/common/item/ItemSlingshot.java +++ b/src/main/java/vazkii/botania/common/item/ItemSlingshot.java @@ -52,7 +52,7 @@ public class ItemSlingshot extends ItemMod { ball.shoot(living, living.rotationPitch, living.rotationYaw, 0F, 1.5F, 1F); ball.setMotion(ball.getMotion().scale(1.6)); world.addEntity(ball); - world.playSound(null, living.posX, living.posY, living.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 0.5F, 0.4F / (random.nextFloat() * 0.4F + 0.8F)); + world.playSound(null, living.getX(), living.getY(), living.getZ(), SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 0.5F, 0.4F / (random.nextFloat() * 0.4F + 0.8F)); } } @@ -73,10 +73,10 @@ public class ItemSlingshot extends ItemMod { ItemStack stack = player.getHeldItem(hand); if(player.abilities.isCreativeMode || PlayerHelper.hasAmmo(player, AMMO_FUNC)) { player.setActiveHand(hand); - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + return ActionResult.success(stack); } - return ActionResult.newResult(ActionResultType.PASS, stack); + return ActionResult.pass(stack); } } diff --git a/src/main/java/vazkii/botania/common/item/ItemTemperanceStone.java b/src/main/java/vazkii/botania/common/item/ItemTemperanceStone.java index 412e8ebb7..64ef44c0f 100644 --- a/src/main/java/vazkii/botania/common/item/ItemTemperanceStone.java +++ b/src/main/java/vazkii/botania/common/item/ItemTemperanceStone.java @@ -45,8 +45,8 @@ public class ItemTemperanceStone extends ItemMod { public ActionResult onItemRightClick(World world, PlayerEntity player, @Nonnull Hand hand) { ItemStack stack = player.getHeldItem(hand); ItemNBTHelper.setBoolean(stack, TAG_ACTIVE, !ItemNBTHelper.getBoolean(stack, TAG_ACTIVE, false)); - world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, SoundCategory.NEUTRAL, 0.3F, 0.1F); - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + world.playSound(null, player.getX(), player.getY(), player.getZ(), SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP, SoundCategory.NEUTRAL, 0.3F, 0.1F); + return ActionResult.success(stack); } @Override diff --git a/src/main/java/vazkii/botania/common/item/ItemThornChakram.java b/src/main/java/vazkii/botania/common/item/ItemThornChakram.java index 54c4bcbb2..4f02e4351 100644 --- a/src/main/java/vazkii/botania/common/item/ItemThornChakram.java +++ b/src/main/java/vazkii/botania/common/item/ItemThornChakram.java @@ -41,11 +41,11 @@ public class ItemThornChakram extends ItemMod { if(stack.getItem() == ModItems.flareChakram) c.setFire(true); world.addEntity(c); - world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 0.5F, 0.4F / (random.nextFloat() * 0.4F + 0.8F)); + world.playSound(null, player.getX(), player.getY(), player.getZ(), SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 0.5F, 0.4F / (random.nextFloat() * 0.4F + 0.8F)); stack.shrink(1); } - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + return ActionResult.success(stack); } } diff --git a/src/main/java/vazkii/botania/common/item/ItemTwigWand.java b/src/main/java/vazkii/botania/common/item/ItemTwigWand.java index 4a4b6c437..e35cc365d 100644 --- a/src/main/java/vazkii/botania/common/item/ItemTwigWand.java +++ b/src/main/java/vazkii/botania/common/item/ItemTwigWand.java @@ -159,7 +159,7 @@ public class ItemTwigWand extends ItemMod implements ICoordBoundItem { pos.getX(), pos.getY(), pos.getZ())); } - world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.ding, SoundCategory.PLAYERS, 1F, 1F); + world.playSound(null, player.getX(), player.getY(), player.getZ(), ModSounds.ding, SoundCategory.PLAYERS, 1F, 1F); return true; } return false; @@ -294,7 +294,7 @@ public class ItemTwigWand extends ItemMod implements ICoordBoundItem { else player.playSound(ModSounds.ding, 0.1F, 1F); } - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + return ActionResult.success(stack); } @Override diff --git a/src/main/java/vazkii/botania/common/item/ItemVineBall.java b/src/main/java/vazkii/botania/common/item/ItemVineBall.java index 1cc71a19b..34de208f4 100644 --- a/src/main/java/vazkii/botania/common/item/ItemVineBall.java +++ b/src/main/java/vazkii/botania/common/item/ItemVineBall.java @@ -34,7 +34,7 @@ public class ItemVineBall extends ItemMod { if(!player.abilities.isCreativeMode) player.getHeldItem(hand).shrink(1); - world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 0.5F, 0.4F / (random.nextFloat() * 0.4F + 0.8F)); + world.playSound(null, player.getX(), player.getY(), player.getZ(), SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 0.5F, 0.4F / (random.nextFloat() * 0.4F + 0.8F)); if(!world.isRemote) { EntityVineBall ball = new EntityVineBall(player, true); @@ -42,7 +42,7 @@ public class ItemVineBall extends ItemMod { world.addEntity(ball); } - return ActionResult.newResult(ActionResultType.SUCCESS, player.getHeldItem(hand)); + return ActionResult.success(player.getHeldItem(hand)); } } diff --git a/src/main/java/vazkii/botania/common/item/ItemVirus.java b/src/main/java/vazkii/botania/common/item/ItemVirus.java index 24fe1c1fe..91126d879 100644 --- a/src/main/java/vazkii/botania/common/item/ItemVirus.java +++ b/src/main/java/vazkii/botania/common/item/ItemVirus.java @@ -72,7 +72,7 @@ public class ItemVirus extends ItemMod { ? EntityType.ZOMBIE_HORSE.create(player.world) : EntityType.SKELETON_HORSE.create(player.world); newHorse.setTamedBy(player); - newHorse.setPositionAndRotation(horse.posX, horse.posY, horse.posZ, horse.rotationYaw, horse.rotationPitch); + newHorse.setPositionAndRotation(horse.getX(), horse.getY(), horse.getZ(), horse.rotationYaw, horse.rotationPitch); // Put the saddle back if(!saddle.isEmpty()) diff --git a/src/main/java/vazkii/botania/common/item/ItemWorldSeed.java b/src/main/java/vazkii/botania/common/item/ItemWorldSeed.java index 13f314ea1..2bf93f9aa 100644 --- a/src/main/java/vazkii/botania/common/item/ItemWorldSeed.java +++ b/src/main/java/vazkii/botania/common/item/ItemWorldSeed.java @@ -40,17 +40,17 @@ public class ItemWorldSeed extends ItemMod { return new ActionResult<>(ActionResultType.SUCCESS, stack); BlockPos coords = world.getSpawnPoint(); - if(world.getDimension().canRespawnHere() && MathHelper.pointDistanceSpace(coords.getX() + 0.5, coords.getY() + 0.5, coords.getZ() + 0.5, player.posX, player.posY, player.posZ) > 24) { + if(world.getDimension().canRespawnHere() && MathHelper.pointDistanceSpace(coords.getX() + 0.5, coords.getY() + 0.5, coords.getZ() + 0.5, player.getX(), player.getY(), player.getZ()) > 24) { player.rotationPitch = 0F; player.rotationYaw = 0F; player.setPositionAndUpdate(coords.getX() + 0.5, coords.getY() + 0.5, coords.getZ() + 0.5); while(!world.isCollisionBoxesEmpty(player, player.getBoundingBox())) - player.setPositionAndUpdate(player.posX, player.posY + 1, player.posZ); + player.setPositionAndUpdate(player.getX(), player.getY() + 1, player.getZ()); - world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ENDERMAN_TELEPORT, SoundCategory.PLAYERS, 1F, 1F); + world.playSound(null, player.getX(), player.getY(), player.getZ(), SoundEvents.ENTITY_ENDERMAN_TELEPORT, SoundCategory.PLAYERS, 1F, 1F); SparkleParticleData data = SparkleParticleData.sparkle(1F, 0.25F, 1F, 0.25F, 10); - ((ServerWorld) world).spawnParticle(data, player.posX, player.posY+ player.getHeight() / 2, player.posZ, 50, player.getWidth() / 8, player.getHeight() / 4, player.getWidth() / 8, 0); + ((ServerWorld) world).spawnParticle(data, player.getX(), player.getY()+ player.getHeight() / 2, player.getZ(), 50, player.getWidth() / 8, player.getHeight() / 4, player.getWidth() / 8, 0); stack.shrink(1); return new ActionResult<>(ActionResultType.SUCCESS, stack); diff --git a/src/main/java/vazkii/botania/common/item/brew/ItemBrewBase.java b/src/main/java/vazkii/botania/common/item/brew/ItemBrewBase.java index 196fa97f8..a75736d56 100644 --- a/src/main/java/vazkii/botania/common/item/brew/ItemBrewBase.java +++ b/src/main/java/vazkii/botania/common/item/brew/ItemBrewBase.java @@ -82,7 +82,7 @@ public class ItemBrewBase extends ItemMod implements IBrewItem { @Override public ActionResult onItemRightClick(World world, PlayerEntity player, @Nonnull Hand hand) { player.setActiveHand(hand); - return ActionResult.newResult(ActionResultType.SUCCESS, player.getHeldItem(hand)); + return ActionResult.success(player.getHeldItem(hand)); } @Nonnull @@ -97,7 +97,7 @@ public class ItemBrewBase extends ItemMod implements IBrewItem { } if(world.rand.nextBoolean()) - world.playSound(null, living.posX, living.posY, living.posZ, SoundEvents.ENTITY_PLAYER_BURP, SoundCategory.PLAYERS, 1F, 1F); + world.playSound(null, living.getX(), living.getY(), living.getZ(), SoundEvents.ENTITY_PLAYER_BURP, SoundCategory.PLAYERS, 1F, 1F); int swigs = getSwigsLeft(stack); if(living instanceof PlayerEntity && !((PlayerEntity) living).abilities.isCreativeMode) { diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumArmor.java b/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumArmor.java index 66247f97c..c9943871a 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumArmor.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/elementium/ItemElementiumArmor.java @@ -4,7 +4,7 @@ import net.minecraft.client.renderer.entity.model.BipedModel; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.ItemStack; -import net.minecraft.util.LazyLoadBase; +import net.minecraft.util.LazyValue; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TranslationTextComponent; @@ -37,7 +37,7 @@ public abstract class ItemElementiumArmor extends ItemManasteelArmor implements return ConfigHandler.CLIENT.enableArmorModels.get() ? LibResources.MODEL_ELEMENTIUM_NEW : slot == EquipmentSlotType.LEGS ? LibResources.MODEL_ELEMENTIUM_1 : LibResources.MODEL_ELEMENTIUM_0; } - private static final LazyLoadBase armorSet = new LazyLoadBase<>(() -> new ItemStack[] { + private static final LazyValue armorSet = new LazyValue<>(() -> new ItemStack[] { new ItemStack(ModItems.elementiumHelm), new ItemStack(ModItems.elementiumChest), new ItemStack(ModItems.elementiumLegs), diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelArmor.java b/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelArmor.java index 820e0b279..4f9457831 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelArmor.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/manasteel/ItemManasteelArmor.java @@ -21,7 +21,7 @@ import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.ArmorItem; import net.minecraft.item.IArmorMaterial; import net.minecraft.item.ItemStack; -import net.minecraft.util.LazyLoadBase; +import net.minecraft.util.LazyValue; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.TextFormatting; @@ -53,7 +53,7 @@ public class ItemManasteelArmor extends ArmorItem implements IManaUsingItem, IPh private static final String TAG_PHANTOM_INK = "phantomInk"; - private final LazyLoadBase model; + private final LazyValue model; public final EquipmentSlotType type; public ItemManasteelArmor(EquipmentSlotType type, Properties props) { @@ -63,7 +63,7 @@ public class ItemManasteelArmor extends ArmorItem implements IManaUsingItem, IPh public ItemManasteelArmor(EquipmentSlotType type, IArmorMaterial mat, Properties props) { super(mat, type, props); this.type = type; - this.model = DistExecutor.runForDist(() -> () -> new LazyLoadBase<>(() -> this.provideArmorModelForSlot(type)), + this.model = DistExecutor.runForDist(() -> () -> new LazyValue<>(() -> this.provideArmorModelForSlot(type)), () -> () -> null); } @@ -138,7 +138,7 @@ public class ItemManasteelArmor extends ArmorItem implements IManaUsingItem, IPh list.add(new TranslationTextComponent("botaniamisc.hasPhantomInk").applyTextStyle(TextFormatting.GRAY)); } - private static final LazyLoadBase armorSet = new LazyLoadBase<>(() -> new ItemStack[] { + private static final LazyValue armorSet = new LazyValue<>(() -> new ItemStack[] { new ItemStack(ModItems.manasteelHelm), new ItemStack(ModItems.manasteelChest), new ItemStack(ModItems.manasteelLegs), diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveArmor.java b/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveArmor.java index ac49f47dc..61f8475a3 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveArmor.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/manaweave/ItemManaweaveArmor.java @@ -15,7 +15,7 @@ import net.minecraft.client.util.ITooltipFlag; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.ItemStack; -import net.minecraft.util.LazyLoadBase; +import net.minecraft.util.LazyValue; import net.minecraft.util.ResourceLocation; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.StringTextComponent; @@ -63,7 +63,7 @@ public class ItemManaweaveArmor extends ItemManasteelArmor { return name; } - private static final LazyLoadBase armorSet = new LazyLoadBase<>(() -> new ItemStack[] { + private static final LazyValue armorSet = new LazyValue<>(() -> new ItemStack[] { new ItemStack(ModItems.manaweaveHelm), new ItemStack(ModItems.manaweaveChest), new ItemStack(ModItems.manaweaveLegs), diff --git a/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelArmor.java b/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelArmor.java index b430b918b..1fc244c18 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelArmor.java +++ b/src/main/java/vazkii/botania/common/item/equipment/armor/terrasteel/ItemTerrasteelArmor.java @@ -17,7 +17,7 @@ import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.ItemStack; -import net.minecraft.util.LazyLoadBase; +import net.minecraft.util.LazyValue; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TranslationTextComponent; @@ -64,7 +64,7 @@ public class ItemTerrasteelArmor extends ItemManasteelArmor { return multimap; } - private static final LazyLoadBase armorSet = new LazyLoadBase<>(() -> new ItemStack[] { + private static final LazyValue armorSet = new LazyValue<>(() -> new ItemStack[] { new ItemStack(ModItems.terrasteelHelm), new ItemStack(ModItems.terrasteelChest), new ItemStack(ModItems.terrasteelLegs), diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBalanceCloak.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBalanceCloak.java index 8410456bf..99d05ad9e 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBalanceCloak.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemBalanceCloak.java @@ -41,11 +41,11 @@ public class ItemBalanceCloak extends ItemHolyCloak { if(event.getAmount() > player.getHealth()) event.setAmount(player.getHealth() - 1); - player.world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.holyCloak, SoundCategory.PLAYERS, 1F, 1F); + player.world.playSound(null, player.getX(), player.getY(), player.getZ(), ModSounds.holyCloak, SoundCategory.PLAYERS, 1F, 1F); for(int i = 0; i < 30; i++) { - double x = player.posX + Math.random() * player.getWidth() * 2 - player.getWidth(); - double y = player.posY + Math.random() * player.getHeight(); - double z = player.posZ + Math.random() * player.getWidth() * 2 - player.getWidth(); + double x = player.getX() + Math.random() * player.getWidth() * 2 - player.getWidth(); + double y = player.getY() + Math.random() * player.getHeight(); + double z = player.getZ() + Math.random() * player.getWidth() * 2 - player.getWidth(); boolean green = Math.random() > 0.5; float g = green ? 1F : 0.3F; float b = green ? 0.3F : 1F; diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemDivaCharm.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemDivaCharm.java index bb24d55cd..92591856c 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemDivaCharm.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemDivaCharm.java @@ -66,7 +66,7 @@ public class ItemDivaCharm extends ItemBauble implements IManaUsingItem { if(ManaItemHandler.requestManaExact(amulet, player, cost, false)) { final int range = 20; - List mobs = player.world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(target.posX - range, target.posY - range, target.posZ - range, target.posX + range, target.posY + range, target.posZ + range), Predicates.instanceOf(IMob.class)); + List mobs = player.world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(target.getX() - range, target.getY() - range, target.getZ() - range, target.getX() + range, target.getY() + range, target.getZ() + range), Predicates.instanceOf(IMob.class)); if(mobs.size() > 1) { if(SubTileHeiseiDream.brainwashEntity(target, (List) mobs)) { target.heal(target.getMaxHealth()); @@ -75,8 +75,8 @@ public class ItemDivaCharm extends ItemBauble implements IManaUsingItem { ((CreeperEntity) event.getEntityLiving()).timeSinceIgnited = 2; ManaItemHandler.requestManaExact(amulet, player, cost, true); - player.world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.divaCharm, SoundCategory.PLAYERS, 1F, 1F); - PacketHandler.sendToNearby(target.world, target, new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.DIVA_EFFECT, target.posX, target.posY, target.posZ, target.getEntityId())); + player.world.playSound(null, player.getX(), player.getY(), player.getZ(), ModSounds.divaCharm, SoundCategory.PLAYERS, 1F, 1F); + PacketHandler.sendToNearby(target.world, target, new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.DIVA_EFFECT, target.getX(), target.getY(), target.getZ(), target.getEntityId())); } } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemDodgeRing.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemDodgeRing.java index 24e5a0733..aa3662b82 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemDodgeRing.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemDodgeRing.java @@ -99,8 +99,8 @@ public class ItemDodgeRing extends ItemBauble { @OnlyIn(Dist.CLIENT) public static void renderHUD(PlayerEntity player, ItemStack stack, float pticks) { - int xo = Minecraft.getInstance().mainWindow.getScaledWidth() / 2 - 20; - int y = Minecraft.getInstance().mainWindow.getScaledHeight() / 2 + 20; + int xo = Minecraft.getInstance().getWindow().getScaledWidth() / 2 - 20; + int y = Minecraft.getInstance().getWindow().getScaledHeight() / 2 + 20; if(!player.abilities.isFlying) { int cd = ItemNBTHelper.getInt(stack, TAG_DODGE_COOLDOWN, 0); diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemFlightTiara.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemFlightTiara.java index 49f6876e5..dbbd12f15 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemFlightTiara.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemFlightTiara.java @@ -119,9 +119,9 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem { if(!player.world.isRemote) ManaItemHandler.requestManaExact(tiara, player, getCost(tiara, left), true); else if(Math.abs(player.getMotion().getX()) > 0.1 || Math.abs(player.getMotion().getZ()) > 0.1) { - double x = event.getEntityLiving().posX - 0.5; - double y = event.getEntityLiving().posY - 0.5; - double z = event.getEntityLiving().posZ - 0.5; + double x = event.getEntityLiving().getX() - 0.5; + double y = event.getEntityLiving().getY() - 0.5; + double z = event.getEntityLiving().getZ() - 0.5; player.getGameProfile().getName(); float r = 1F; @@ -260,7 +260,7 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem { int cooldown = ItemNBTHelper.getInt(stack, TAG_DASH_COOLDOWN, 0); if(!wasSprting && isSprinting && cooldown == 0) { p.setMotion(p.getMotion().add(look.x, 0, look.z)); - p.world.playSound(null, p.posX, p.posY, p.posZ, ModSounds.dash, SoundCategory.PLAYERS, 1F, 1F); + p.world.playSound(null, p.getX(), p.getY(), p.getZ(), ModSounds.dash, SoundCategory.PLAYERS, 1F, 1F); ItemNBTHelper.setInt(stack, TAG_DASH_COOLDOWN, maxCd); } else if(cooldown > 0) { if(maxCd - cooldown < 2) @@ -470,11 +470,11 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem { Minecraft mc = Minecraft.getInstance(); mc.textureManager.bindTexture(textureHud); - int xo = mc.mainWindow.getScaledWidth() / 2 + 10; + int xo = mc.getWindow().getScaledWidth() / 2 + 10; int x = xo; - int y = mc.mainWindow.getScaledHeight() - ConfigHandler.CLIENT.flightBarHeight.get(); + int y = mc.getWindow().getScaledHeight() - ConfigHandler.CLIENT.flightBarHeight.get(); if(player.areEyesInFluid(FluidTags.WATER)) - y = mc.mainWindow.getScaledHeight() - ConfigHandler.CLIENT.flightBarBreathHeight.get(); + y = mc.getWindow().getScaledHeight() - ConfigHandler.CLIENT.flightBarBreathHeight.get(); int left = ItemNBTHelper.getInt(stack, TAG_TIME_LEFT, MAX_FLY_TIME); diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemHolyCloak.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemHolyCloak.java index 61d3702f1..2b596adb8 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemHolyCloak.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemHolyCloak.java @@ -102,11 +102,11 @@ public class ItemHolyCloak extends ItemBauble { public boolean effectOnDamage(LivingHurtEvent event, PlayerEntity player, ItemStack stack) { if(!event.getSource().isMagicDamage()) { event.setCanceled(true); - player.world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.holyCloak, SoundCategory.PLAYERS, 1F, 1F); + player.world.playSound(null, player.getX(), player.getY(), player.getZ(), ModSounds.holyCloak, SoundCategory.PLAYERS, 1F, 1F); for(int i = 0; i < 30; i++) { - double x = player.posX + Math.random() * player.getWidth() * 2 - player.getWidth(); - double y = player.posY + Math.random() * player.getHeight(); - double z = player.posZ + Math.random() * player.getWidth() * 2 - player.getWidth(); + double x = player.getX() + Math.random() * player.getWidth() * 2 - player.getWidth(); + double y = player.getY() + Math.random() * player.getHeight(); + double z = player.getZ() + Math.random() * player.getWidth() * 2 - player.getWidth(); boolean yellow = Math.random() > 0.5; float r = yellow ? 1F : 0.3F; float g = yellow ? 1F : 0.3F; diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemIcePendant.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemIcePendant.java index 35bc51133..20ebbb07f 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemIcePendant.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemIcePendant.java @@ -45,14 +45,14 @@ public class ItemIcePendant extends ItemBauble { FrostWalkerEnchantment.freezeNearby(entity, entity.world, new BlockPos(entity), 8); entity.onGround = lastOnGround; - int x = MathHelper.floor(entity.posX); - int y = MathHelper.floor(entity.posY); - int z = MathHelper.floor(entity.posZ); + int x = MathHelper.floor(entity.getX()); + int y = MathHelper.floor(entity.getY()); + int z = MathHelper.floor(entity.getZ()); BlockState blockstate = Blocks.SNOW.getDefaultState(); for(int l = 0; l < 4; ++l) { - x = MathHelper.floor(entity.posX + (double)((float)(l % 2 * 2 - 1) * 0.25F)); - z = MathHelper.floor(entity.posZ + (double)((float)(l / 2 % 2 * 2 - 1) * 0.25F)); + x = MathHelper.floor(entity.getX() + (double)((float)(l % 2 * 2 - 1) * 0.25F)); + z = MathHelper.floor(entity.getZ() + (double)((float)(l / 2 % 2 * 2 - 1) * 0.25F)); BlockPos blockpos = new BlockPos(x, y, z); if (entity.world.isAirBlock(blockpos) && entity.world.getBiome(blockpos).func_225486_c(blockpos) < 0.9F && blockstate.isValidPosition(entity.world, blockpos)) { entity.world.setBlockState(blockpos, blockstate); @@ -61,7 +61,7 @@ public class ItemIcePendant extends ItemBauble { } else if (entity.world.isRemote && !entity.isSneaking()) { if(entity.world.rand.nextFloat() >= 0.25F) { - entity.world.addParticle(new BlockParticleData(ParticleTypes.FALLING_DUST, Blocks.SNOW_BLOCK.getDefaultState()), entity.posX + entity.world.rand.nextFloat() * 0.6 - 0.3, entity.posY + 1.1, entity.posZ + entity.world.rand.nextFloat() * 0.6 - 0.3, 0, -0.15, 0); + entity.world.addParticle(new BlockParticleData(ParticleTypes.FALLING_DUST, Blocks.SNOW_BLOCK.getDefaultState()), entity.getX() + entity.world.rand.nextFloat() * 0.6 - 0.3, entity.getY() + 1.1, entity.getZ() + entity.world.rand.nextFloat() * 0.6 - 0.3, 0, -0.15, 0); } } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemItemFinder.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemItemFinder.java index 504e61f40..aa6d48f4d 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemItemFinder.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemItemFinder.java @@ -104,7 +104,7 @@ public class ItemItemFinder extends ItemBauble { Entity e = player.world.getEntityByID(i); if(e != null && Math.random() < 0.6) { WispParticleData data = WispParticleData.wisp(0.15F + 0.05F * (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), Math.random() < 0.6); - player.world.addParticle(data, e.posX + (float) (Math.random() * 0.5 - 0.25) * 0.45F, e.posY + e.getHeight(), e.posZ + (float) (Math.random() * 0.5 - 0.25) * 0.45F, 0, 0.05F + 0.03F * (float) Math.random(), 0); + player.world.addParticle(data, e.getX() + (float) (Math.random() * 0.5 - 0.25) * 0.45F, e.getY() + e.getHeight(), e.getZ() + (float) (Math.random() * 0.5 - 0.25) * 0.45F, 0, 0.05F + 0.03F * (float) Math.random(), 0); } } } @@ -126,7 +126,7 @@ public class ItemItemFinder extends ItemBauble { if(!pstack.isEmpty() || player.isSneaking()) { int range = 24; - List entities = player.world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range)); + List entities = player.world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(player.getX() - range, player.getY() - range, player.getZ() - range, player.getX() + range, player.getY() + range, player.getZ() + range)); for(Entity e : entities) { if(e == player) continue; diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMagnetRing.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMagnetRing.java index 4e8a30c61..9f1f5e216 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMagnetRing.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMagnetRing.java @@ -72,9 +72,9 @@ public class ItemMagnetRing extends ItemBauble { if(cooldown <= 0) { if(living.isSneaking() == ConfigHandler.COMMON.invertMagnetRing.get()) { - double x = living.posX; - double y = living.posY + 0.75; - double z = living.posZ; + double x = living.getX(); + double y = living.getY() + 0.75; + double z = living.getZ(); int range = ((ItemMagnetRing) stack.getItem()).range; List items = living.world.getEntitiesWithinAABB(ItemEntity.class, new AxisAlignedBB(x - range, y - range, z - range, x + range, y + range, z + range)); @@ -90,7 +90,7 @@ public class ItemMagnetRing extends ItemBauble { float r = red ? 1F : 0F; float b = red ? 0F : 1F; SparkleParticleData data = SparkleParticleData.sparkle(1F, r, 0F, b, 3); - living.world.addParticle(data, item.posX, item.posY, item.posZ, 0, 0, 0); + living.world.addParticle(data, item.getX(), item.getY(), item.getZ(), 0, 0, 0); } pulled++; } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMonocle.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMonocle.java index 5f9371b3c..3a659524a 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMonocle.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemMonocle.java @@ -89,8 +89,8 @@ public class ItemMonocle extends ItemBauble implements IBurstViewerBauble, ICosm if(dispStack.isEmpty()) return; - int x = mc.mainWindow.getScaledWidth() / 2 + 15; - int y = mc.mainWindow.getScaledHeight() / 2 - 8; + int x = mc.getWindow().getScaledWidth() / 2 + 15; + int y = mc.getWindow().getScaledHeight() / 2 - 8; net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting(); mc.getItemRenderer().renderItemAndEffectIntoGUI(dispStack, x, y); diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemSpeedUpBelt.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemSpeedUpBelt.java index fa4743453..32da907d2 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemSpeedUpBelt.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemSpeedUpBelt.java @@ -58,11 +58,11 @@ public class ItemSpeedUpBelt extends ItemTravelBelt { double oldY = ItemNBTHelper.getDouble(stack, TAG_OLD_Y, 0); double oldZ = ItemNBTHelper.getDouble(stack, TAG_OLD_Z, 0); - ItemNBTHelper.setDouble(stack, TAG_OLD_X, player.posX); - ItemNBTHelper.setDouble(stack, TAG_OLD_Y, player.posY); - ItemNBTHelper.setDouble(stack, TAG_OLD_Z, player.posZ); + ItemNBTHelper.setDouble(stack, TAG_OLD_X, player.getX()); + ItemNBTHelper.setDouble(stack, TAG_OLD_Y, player.getY()); + ItemNBTHelper.setDouble(stack, TAG_OLD_Z, player.getZ()); - return Math.abs(oldX - player.posX) > 0.001 || Math.abs(oldY - player.posY) > 0.001 || Math.abs(oldZ - player.posZ) > 0.001; + return Math.abs(oldX - player.getX()) > 0.001 || Math.abs(oldY - player.getY()) > 0.001 || Math.abs(oldZ - player.getZ()) > 0.001; } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemThirdEye.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemThirdEye.java index 15c4d178c..5f2dcc284 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemThirdEye.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemThirdEye.java @@ -49,7 +49,7 @@ public class ItemThirdEye extends ItemBauble implements IManaUsingItem { PlayerEntity eplayer = (PlayerEntity) living; double range = 24; - AxisAlignedBB aabb = new AxisAlignedBB(living.posX, living.posY, living.posZ, living.posX, living.posY, living.posZ).grow(range); + AxisAlignedBB aabb = new AxisAlignedBB(living.getX(), living.getY(), living.getZ(), living.getX(), living.getY(), living.getZ()).grow(range); List mobs = living.world.getEntitiesWithinAABB(LivingEntity.class, aabb, (Entity e) -> e instanceof IMob); for(LivingEntity e : mobs) { diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemTinyPlanet.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemTinyPlanet.java index 3e094f138..86302dec6 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemTinyPlanet.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemTinyPlanet.java @@ -40,9 +40,9 @@ public class ItemTinyPlanet extends ItemBauble { @Override public void onWornTick(ItemStack stack, LivingEntity player) { - double x = player.posX; - double y = player.posY + player.getEyeHeight(); - double z = player.posZ; + double x = player.getX(); + double y = player.getY() + player.getEyeHeight(); + double z = player.getZ(); applyEffect(player.world, x, y, z); } @@ -77,7 +77,7 @@ public class ItemTinyPlanet extends ItemBauble { float zTarget = (float) (z + Math.sin(angle * 10 * Math.PI / 180F) * radius); Vector3 targetVec = new Vector3(xTarget, yTarget, zTarget); - Vector3 currentVec = new Vector3(entity.posX, entity.posY, entity.posZ); + Vector3 currentVec = new Vector3(entity.getX(), entity.getY(), entity.getZ()); Vector3 moveVector = targetVec.subtract(currentVec); burst.setBurstMotion(moveVector.x, moveVector.y, moveVector.z); diff --git a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemUnholyCloak.java b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemUnholyCloak.java index c07e99263..5b32932dd 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemUnholyCloak.java +++ b/src/main/java/vazkii/botania/common/item/equipment/bauble/ItemUnholyCloak.java @@ -42,20 +42,20 @@ public class ItemUnholyCloak extends ItemHolyCloak { public boolean effectOnDamage(LivingHurtEvent event, PlayerEntity player, ItemStack stack) { if(!event.getSource().isUnblockable()) { int range = 6; - List mobs = player.world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(player.posX - range, player.posY - range, player.posZ - range, player.posX + range, player.posY + range, player.posZ + range), Predicates.instanceOf(IMob.class)); + List mobs = player.world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(player.getX() - range, player.getY() - range, player.getZ() - range, player.getX() + range, player.getY() + range, player.getZ() + range), Predicates.instanceOf(IMob.class)); for(IMob mob : (List) mobs) if(mob instanceof LivingEntity) { LivingEntity entity = (LivingEntity) mob; entity.attackEntityFrom(DamageSource.causePlayerDamage(player), event.getAmount()); } - player.world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.unholyCloak, SoundCategory.PLAYERS, 1F, 1F); + player.world.playSound(null, player.getX(), player.getY(), player.getZ(), ModSounds.unholyCloak, SoundCategory.PLAYERS, 1F, 1F); for(int i = 0; i < 90; i++) { float rad = i * 4F * (float) Math.PI / 180F; float xMotion = (float) Math.cos(rad) * 0.2F; float zMotion = (float) Math.sin(rad) * 0.2F; WispParticleData data = WispParticleData.wisp(0.6F + (float) Math.random() * 0.2F, 0.4F + (float) Math.random() + 0.25F, 0F, 0F); - player.world.addParticle(data, player.posX, player.posY + 0.5, player.posZ, xMotion, 0F, zMotion); + player.world.addParticle(data, player.getX(), player.getY() + 0.5, player.getZ(), xMotion, 0F, zMotion); } return true; diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/ItemStarSword.java b/src/main/java/vazkii/botania/common/item/equipment/tool/ItemStarSword.java index b081a1f17..3feec0e27 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/ItemStarSword.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/ItemStarSword.java @@ -66,7 +66,7 @@ public class ItemStarSword extends ItemManasteelSword { } ToolCommons.damageItem(par1ItemStack, 1, player, MANA_PER_DAMAGE); - world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.starcaller, SoundCategory.PLAYERS, 0.4F, 1.4F); + world.playSound(null, player.getX(), player.getY(), player.getZ(), ModSounds.starcaller, SoundCategory.PLAYERS, 0.4F, 1.4F); } } } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/ItemThunderSword.java b/src/main/java/vazkii/botania/common/item/equipment/tool/ItemThunderSword.java index e2c9a9794..512a410e3 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/ItemThunderSword.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/ItemThunderSword.java @@ -55,7 +55,7 @@ public class ItemThunderSword extends ItemManasteelSword { LivingEntity lightningSource = entity; int hops = entity.world.isThundering() ? 10 : 4; for(int i = 0; i < hops; i++) { - List entities = entity.world.getEntitiesInAABBexcluding(lightningSource, new AxisAlignedBB(lightningSource.posX - range, lightningSource.posY - range, lightningSource.posZ - range, lightningSource.posX + range, lightningSource.posY + range, lightningSource.posZ + range), selector::test); + List entities = entity.world.getEntitiesInAABBexcluding(lightningSource, new AxisAlignedBB(lightningSource.getX() - range, lightningSource.getY() - range, lightningSource.getZ() - range, lightningSource.getX() + range, lightningSource.getY() + range, lightningSource.getZ() + range), selector::test); if(entities.isEmpty()) break; diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/bow/ItemLivingwoodBow.java b/src/main/java/vazkii/botania/common/item/equipment/tool/bow/ItemLivingwoodBow.java index 35ffadf2c..ca2798a7e 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/bow/ItemLivingwoodBow.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/bow/ItemLivingwoodBow.java @@ -123,7 +123,7 @@ public class ItemLivingwoodBow extends BowItem implements IManaUsingItem { worldIn.addEntity(abstractarrowentity); } - worldIn.playSound((PlayerEntity)null, playerentity.posX, playerentity.posY, playerentity.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 1.0F, 1.0F / (random.nextFloat() * 0.4F + 1.2F) + f * 0.5F); + worldIn.playSound((PlayerEntity)null, playerentity.getX(), playerentity.getY(), playerentity.getZ(), SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 1.0F, 1.0F / (random.nextFloat() * 0.4F + 1.2F) + f * 0.5F); if (!flag1 && !playerentity.abilities.isCreativeMode) { itemstack.shrink(1); if (itemstack.isEmpty()) { diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumAxe.java b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumAxe.java index ae5018d72..89320b67f 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumAxe.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumAxe.java @@ -55,7 +55,7 @@ public class ItemElementiumAxe extends ItemManasteelAxe { } private void addDrop(LivingDropsEvent event, ItemStack drop) { - ItemEntity entityitem = new ItemEntity(event.getEntityLiving().world, event.getEntityLiving().posX, event.getEntityLiving().posY, event.getEntityLiving().posZ, drop); + ItemEntity entityitem = new ItemEntity(event.getEntityLiving().world, event.getEntityLiving().getX(), event.getEntityLiving().getY(), event.getEntityLiving().getZ(), drop); entityitem.setPickupDelay(10); event.getDrops().add(entityitem); } diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShears.java b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShears.java index e2a4c5ad4..d1d257ea6 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShears.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumShears.java @@ -47,7 +47,7 @@ public class ItemElementiumShears extends ItemManasteelShears { @Override public ActionResult onItemRightClick(World world, PlayerEntity player, @Nonnull Hand hand) { player.setActiveHand(hand); - return ActionResult.newResult(ActionResultType.SUCCESS, player.getHeldItem(hand)); + return ActionResult.success(player.getHeldItem(hand)); } @Override @@ -57,7 +57,7 @@ public class ItemElementiumShears extends ItemManasteelShears { if(count != getUseDuration(stack) && count % 5 == 0) { int range = 12; - List sheep = living.world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(living.posX - range, living.posY - range, living.posZ - range, living.posX + range, living.posY + range, living.posZ + range), Predicates.instanceOf(IShearable.class)); + List sheep = living.world.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(living.getX() - range, living.getY() - range, living.getZ() - range, living.getX() + range, living.getY() + range, living.getZ() + range), Predicates.instanceOf(IShearable.class)); if(sheep.size() > 0) { for(IShearable target : (List) sheep) { Entity entity = (Entity) target; diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraPick.java b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraPick.java index d3f54d5fd..f18ddb68d 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraPick.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraPick.java @@ -116,10 +116,10 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem, ISequ if(level != 0) { setEnabled(stack, !isEnabled(stack)); if(!world.isRemote) - world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.terraPickMode, SoundCategory.PLAYERS, 0.5F, 0.4F); + world.playSound(null, player.getX(), player.getY(), player.getZ(), ModSounds.terraPickMode, SoundCategory.PLAYERS, 0.5F, 0.4F); } - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + return ActionResult.success(stack); } @Nonnull diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraSword.java b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraSword.java index 29b17eefe..3be2cfecc 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraSword.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/terrasteel/ItemTerraSword.java @@ -65,7 +65,7 @@ public class ItemTerraSword extends ItemManasteelSword implements ILensEffect { EntityManaBurst burst = getBurst(player, player.getHeldItemMainhand()); player.world.addEntity(burst); ToolCommons.damageItem(player.getHeldItemMainhand(), 1, player, MANA_PER_DAMAGE); - player.world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.terraBlade, SoundCategory.PLAYERS, 0.4F, 1.4F); + player.world.playSound(null, player.getX(), player.getY(), player.getZ(), ModSounds.terraBlade, SoundCategory.PLAYERS, 0.4F, 1.4F); } } @@ -103,7 +103,7 @@ public class ItemTerraSword extends ItemManasteelSword implements ILensEffect { @Override public void updateBurst(IManaBurst burst, ItemStack stack) { ThrowableEntity entity = (ThrowableEntity) burst; - AxisAlignedBB axis = new AxisAlignedBB(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).grow(1); + AxisAlignedBB axis = new AxisAlignedBB(entity.getX(), entity.getY(), entity.getZ(), entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).grow(1); List entities = entity.world.getEntitiesWithinAABB(LivingEntity.class, axis); LivingEntity thrower = entity.getThrower(); diff --git a/src/main/java/vazkii/botania/common/item/lens/LensDamage.java b/src/main/java/vazkii/botania/common/item/lens/LensDamage.java index d0aef621c..7a2666f9a 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensDamage.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensDamage.java @@ -26,7 +26,7 @@ public class LensDamage extends Lens { public void updateBurst(IManaBurst burst, ThrowableEntity entity, ItemStack stack) { if (entity.world.isRemote) return; - AxisAlignedBB axis = new AxisAlignedBB(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).grow(1); + AxisAlignedBB axis = new AxisAlignedBB(entity.getX(), entity.getY(), entity.getZ(), entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).grow(1); List entities = entity.world.getEntitiesWithinAABB(LivingEntity.class, axis); for(LivingEntity living : entities) { if(living instanceof PlayerEntity) diff --git a/src/main/java/vazkii/botania/common/item/lens/LensExplosive.java b/src/main/java/vazkii/botania/common/item/lens/LensExplosive.java index 9c859fd19..a41420aa4 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensExplosive.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensExplosive.java @@ -26,7 +26,7 @@ public class LensExplosive extends Lens { if(!entity.world.isRemote && !burst.isFake() && pos.getType() == RayTraceResult.Type.BLOCK) { BlockPos coords = burst.getBurstSourceBlockPos(); if(!isManaBlock && !coords.equals(((BlockRayTraceResult) pos).getPos())) - entity.world.createExplosion(entity, entity.posX, entity.posY, entity.posZ, + entity.world.createExplosion(entity, entity.getX(), entity.getY(), entity.getZ(), burst.getMana() / 50F, Explosion.Mode.BREAK); } else dead = false; diff --git a/src/main/java/vazkii/botania/common/item/lens/LensFirework.java b/src/main/java/vazkii/botania/common/item/lens/LensFirework.java index 1490cd3d2..dabcafcfd 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensFirework.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensFirework.java @@ -33,7 +33,7 @@ public class LensFirework extends Lens { && !((BlockRayTraceResult) pos).getPos().equals(coords)) { ItemStack fireworkStack = generateFirework(burst.getColor()); - FireworkRocketEntity rocket = new FireworkRocketEntity(entity.world, entity.posX, entity.posY, entity.posZ, fireworkStack); + FireworkRocketEntity rocket = new FireworkRocketEntity(entity.world, entity.getX(), entity.getY(), entity.getZ(), fireworkStack); entity.world.addEntity(rocket); } } else dead = false; diff --git a/src/main/java/vazkii/botania/common/item/lens/LensInfluence.java b/src/main/java/vazkii/botania/common/item/lens/LensInfluence.java index c9d1159ec..95376615d 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensInfluence.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensInfluence.java @@ -30,7 +30,7 @@ public class LensInfluence extends Lens { public void updateBurst(IManaBurst burst, ThrowableEntity entity, ItemStack stack) { if(!burst.isFake()) { double range = 3.5; - AxisAlignedBB bounds = new AxisAlignedBB(entity.posX - range, entity.posY - range, entity.posZ - range, entity.posX + range, entity.posY + range, entity.posZ + range); + AxisAlignedBB bounds = new AxisAlignedBB(entity.getX() - range, entity.getY() - range, entity.getZ() - range, entity.getX() + range, entity.getY() + range, entity.getZ() + range); List movables = entity.world.getEntitiesWithinAABB(ItemEntity.class, bounds); movables.addAll(entity.world.getEntitiesWithinAABB(ExperienceOrbEntity.class, bounds)); movables.addAll(entity.world.getEntitiesWithinAABB(AbstractArrowEntity.class, bounds)); diff --git a/src/main/java/vazkii/botania/common/item/lens/LensPaint.java b/src/main/java/vazkii/botania/common/item/lens/LensPaint.java index 28503b751..353255c0f 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensPaint.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensPaint.java @@ -43,8 +43,8 @@ public class LensPaint extends Lens { SheepEntity sheep = (SheepEntity) ((EntityRayTraceResult) pos).getEntity(); DyeColor sheepColor = sheep.getFleeceColor(); List sheepList = entity.world.getEntitiesWithinAABB(SheepEntity.class, - new AxisAlignedBB(sheep.posX - r, sheep.posY - r, sheep.posZ - r, - sheep.posX + r, sheep.posY + r, sheep.posZ + r)); + new AxisAlignedBB(sheep.getX() - r, sheep.getY() - r, sheep.getZ() - r, + sheep.getX() + r, sheep.getY() + r, sheep.getZ() + r)); for(SheepEntity other : sheepList) { if(other.getFleeceColor() == sheepColor) other.setFleeceColor(DyeColor.byId(storedColor == 16 ? other.world.rand.nextInt(16) : storedColor)); diff --git a/src/main/java/vazkii/botania/common/item/lens/LensStorm.java b/src/main/java/vazkii/botania/common/item/lens/LensStorm.java index 1bf130709..89c618e52 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensStorm.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensStorm.java @@ -27,7 +27,7 @@ public class LensStorm extends Lens { if(pos.getType() == RayTraceResult.Type.BLOCK && !isManaBlock && !coords.equals(((BlockRayTraceResult) pos).getPos())) - entity.world.createExplosion(entity, entity.posX, entity.posY, entity.posZ, 5F, Explosion.Mode.DESTROY); + entity.world.createExplosion(entity, entity.getX(), entity.getY(), entity.getZ(), 5F, Explosion.Mode.DESTROY); } else dead = false; return dead; diff --git a/src/main/java/vazkii/botania/common/item/lens/LensTripwire.java b/src/main/java/vazkii/botania/common/item/lens/LensTripwire.java index 3fb74cb01..48c32d870 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensTripwire.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensTripwire.java @@ -37,7 +37,7 @@ public class LensTripwire extends Lens { if(entity.world.isRemote) return; - AxisAlignedBB axis = new AxisAlignedBB(entity.posX, entity.posY, entity.posZ, entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).grow(0.25); + AxisAlignedBB axis = new AxisAlignedBB(entity.getX(), entity.getY(), entity.getZ(), entity.lastTickPosX, entity.lastTickPosY, entity.lastTickPosZ).grow(0.25); List entities = entity.world.getEntitiesWithinAABB(LivingEntity.class, axis); if(!entities.isEmpty()) { Entity e = (Entity) burst; diff --git a/src/main/java/vazkii/botania/common/item/material/ItemEnderAir.java b/src/main/java/vazkii/botania/common/item/material/ItemEnderAir.java index f08927ef2..b13d189d3 100644 --- a/src/main/java/vazkii/botania/common/item/material/ItemEnderAir.java +++ b/src/main/java/vazkii/botania/common/item/material/ItemEnderAir.java @@ -58,7 +58,7 @@ public class ItemEnderAir extends ItemMod { if(!player.abilities.isCreativeMode) stack.shrink(1); - world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 0.5F, 0.4F / (random.nextFloat() * 0.4F + 0.8F)); + world.playSound(null, player.getX(), player.getY(), player.getZ(), SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 0.5F, 0.4F / (random.nextFloat() * 0.4F + 0.8F)); if(!world.isRemote) { EntityEnderAirBottle b = new EntityEnderAirBottle(player, world); @@ -66,6 +66,6 @@ public class ItemEnderAir extends ItemMod { world.addEntity(b); } else player.swingArm(hand); - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + return ActionResult.success(stack); } } diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemDice.java b/src/main/java/vazkii/botania/common/item/relic/ItemDice.java index 86afdaa8a..8b9a6ca5f 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemDice.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemDice.java @@ -56,9 +56,9 @@ public class ItemDice extends ItemRelic { if(isRightPlayer(player, stack)) { if(world.isRemote) - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + return ActionResult.success(stack); - world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 0.5F, 0.4F / (world.rand.nextFloat() * 0.4F + 0.8F)); + world.playSound(null, player.getX(), player.getY(), player.getZ(), SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 0.5F, 0.4F / (world.rand.nextFloat() * 0.4F + 0.8F)); List possible = new ArrayList<>(); for(int i = 0; i < 6; i++) { @@ -69,15 +69,15 @@ public class ItemDice extends ItemRelic { if(possible.isEmpty()) { player.sendMessage(new TranslationTextComponent("botaniamisc.dudDiceRoll", world.rand.nextInt(6) + 1).setStyle(new Style().setColor(TextFormatting.DARK_GREEN))); stack.shrink(1); - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + return ActionResult.success(stack); } else { int relic = possible.get(world.rand.nextInt(possible.size())); player.sendMessage(new TranslationTextComponent("botaniamisc.diceRoll", relic + 1).setStyle(new Style().setColor(TextFormatting.DARK_GREEN))); - return ActionResult.newResult(ActionResultType.SUCCESS, new ItemStack(getRelics()[relic])); + return ActionResult.success(new ItemStack(getRelics()[relic])); } } - return ActionResult.newResult(ActionResultType.PASS, stack); + return ActionResult.pass(stack); } @Override diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemFlugelEye.java b/src/main/java/vazkii/botania/common/item/relic/ItemFlugelEye.java index deff6297e..788183255 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemFlugelEye.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemFlugelEye.java @@ -70,7 +70,7 @@ public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUs ItemStack stack = ctx.getItem(); GlobalPos loc = GlobalPos.of(world.getDimension().getType(), pos); ItemNBTHelper.set(stack, TAG_LOCATION, loc.serialize(NBTDynamicOps.INSTANCE)); - world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ENDERMAN_TELEPORT, SoundCategory.PLAYERS, 1F, 5F); + world.playSound(null, player.getX(), player.getY(), player.getZ(), SoundEvents.ENTITY_ENDERMAN_TELEPORT, SoundCategory.PLAYERS, 1F, 5F); } return ActionResultType.SUCCESS; @@ -81,9 +81,9 @@ public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUs @Override public void onUsingTick(ItemStack stack, LivingEntity living, int count) { - float x = (float) (living.posX - Math.random() * living.getWidth()); - float y = (float) (living.posY + Math.random()); - float z = (float) (living.posZ - Math.random() * living.getWidth()); + float x = (float) (living.getX() - Math.random() * living.getWidth()); + float y = (float) (living.getY() + Math.random()); + float z = (float) (living.getZ() - Math.random() * living.getWidth()); WispParticleData data = WispParticleData.wisp((float) Math.random() * 0.7F, (float) Math.random(), (float) Math.random(), (float) Math.random(), 1); living.world.addParticle(data, x, y, z, 0, 0.05F + (float) Math.random() * 0.05F, 0); } @@ -92,7 +92,7 @@ public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUs @Override public ActionResult onItemRightClick(World world, PlayerEntity player, @Nonnull Hand hand) { player.setActiveHand(hand); - return ActionResult.newResult(ActionResultType.SUCCESS, player.getHeldItem(hand)); + return ActionResult.success(player.getHeldItem(hand)); } @Nonnull @@ -106,7 +106,7 @@ public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUs int y = loc.getPos().getY(); int z = loc.getPos().getZ(); - int cost = (int) (MathHelper.pointDistanceSpace(x + 0.5, y + 0.5, z + 0.5, living.posX, living.posY, living.posZ) * 10); + int cost = (int) (MathHelper.pointDistanceSpace(x + 0.5, y + 0.5, z + 0.5, living.getX(), living.getY(), living.getZ()) * 10); if(loc.getDimension() == world.getDimension().getType() && (!(living instanceof PlayerEntity) || ManaItemHandler.requestManaExact(stack, (PlayerEntity) living, cost, true))) { @@ -119,8 +119,8 @@ public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUs } private static void moveParticlesAndSound(Entity entity) { - PacketHandler.sendToNearby(entity.world, entity, new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.FLUGEL_EFFECT, entity.posX, entity.posY, entity.posZ, entity.getEntityId())); - entity.world.playSound(null, entity.posX, entity.posY, entity.posZ, SoundEvents.ENTITY_ENDERMAN_TELEPORT, SoundCategory.PLAYERS, 1F, 1F); + PacketHandler.sendToNearby(entity.world, entity, new PacketBotaniaEffect(PacketBotaniaEffect.EffectType.FLUGEL_EFFECT, entity.getX(), entity.getY(), entity.getZ(), entity.getEntityId())); + entity.world.playSound(null, entity.getX(), entity.getY(), entity.getZ(), SoundEvents.ENTITY_ENDERMAN_TELEPORT, SoundCategory.PLAYERS, 1F, 1F); } @Override diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemInfiniteFruit.java b/src/main/java/vazkii/botania/common/item/relic/ItemInfiniteFruit.java index 22aca92d9..dba1c723a 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemInfiniteFruit.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemInfiniteFruit.java @@ -50,9 +50,9 @@ public class ItemInfiniteFruit extends ItemRelic implements IManaUsingItem { ItemStack stack = player.getHeldItem(hand); if(player.canEat(false) && isRightPlayer(player, stack)) { player.setActiveHand(hand); - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + return ActionResult.success(stack); } - return ActionResult.newResult(ActionResultType.PASS, stack); + return ActionResult.pass(stack); } @Override diff --git a/src/main/java/vazkii/botania/common/item/relic/ItemKingKey.java b/src/main/java/vazkii/botania/common/item/relic/ItemKingKey.java index d5bd3d00d..dffcf84fd 100644 --- a/src/main/java/vazkii/botania/common/item/relic/ItemKingKey.java +++ b/src/main/java/vazkii/botania/common/item/relic/ItemKingKey.java @@ -48,7 +48,7 @@ public class ItemKingKey extends ItemRelic implements IManaUsingItem { player.setActiveHand(hand); ItemStack stack = player.getHeldItem(hand); setCharging(stack, true); - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + return ActionResult.success(stack); } @Override @@ -90,9 +90,9 @@ public class ItemKingKey extends ItemRelic implements IManaUsingItem { Vector3 end = pl.add(axis1); EntityBabylonWeapon weapon = new EntityBabylonWeapon(living, living.world); - weapon.posX = end.x; - weapon.posY = end.y; - weapon.posZ = end.z; + weapon.getX() = end.x; + weapon.getY() = end.y; + weapon.getZ() = end.z; weapon.rotationYaw = living.rotationYaw; weapon.setVariety(rand.nextInt(WEAPON_TYPES)); weapon.setDelay(spawned); diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemDiviningRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemDiviningRod.java index 8c38f484e..1f97422ff 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemDiviningRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemDiviningRod.java @@ -55,11 +55,11 @@ public class ItemDiviningRod extends ItemMod implements IManaUsingItem, IAvatarW long seedxor = world.rand.nextLong(); doHighlight(world, new BlockPos(p), range, seedxor); p.swingArm(hand); - } else world.playSound(null, p.posX, p.posY, p.posZ, ModSounds.divinationRod, SoundCategory.PLAYERS, 1F, 1F); - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + } else world.playSound(null, p.getX(), p.getY(), p.getZ(), ModSounds.divinationRod, SoundCategory.PLAYERS, 1F, 1F); + return ActionResult.success(stack); } - return ActionResult.newResult(ActionResultType.PASS, stack); + return ActionResult.pass(stack); } private void doHighlight(World world, BlockPos pos, int range, long seedxor) { diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemGravityRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemGravityRod.java index fa1700b34..3bb424db0 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemGravityRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemGravityRod.java @@ -135,7 +135,7 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem { if(target != null) { if(BLACKLIST.contains(target.getType())) - return ActionResult.newResult(ActionResultType.FAIL, stack); + return ActionResult.fail(stack); if(ManaItemHandler.requestManaExactForTool(stack, player, COST, true)) { if(target instanceof ItemEntity) @@ -162,7 +162,7 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem { float ym = ((float) Math.random() - 0.5F) * m; float zm = ((float) Math.random() - 0.5F) * m; WispParticleData data = WispParticleData.wisp(s, r, 0F, b); - world.addParticle(data, target.posX + target.getWidth() / 2, target.posY + target.getHeight() / 2, target.posZ + target.getWidth() / 2, xm, ym, zm); + world.addParticle(data, target.getX() + target.getWidth() / 2, target.getY() + target.getHeight() / 2, target.getZ() + target.getWidth() / 2, xm, ym, zm); } MathHelper.setEntityMotionFromVector(target, target3, 0.3333333F); @@ -172,10 +172,10 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem { } ItemNBTHelper.setInt(stack, TAG_TICKS_TILL_EXPIRE, 5); - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + return ActionResult.success(stack); } } - return ActionResult.newResult(ActionResultType.PASS, stack); + return ActionResult.pass(stack); } @Override @@ -215,7 +215,7 @@ public class ItemGravityRod extends ItemMod implements IManaUsingItem { float mot = IManaProficiencyArmor.Helper.hasProficiency(player, stack) ? 2.25F : 1.5F; item.setMotion(moveVector.x * mot, moveVector.y, moveVector.z * mot); if(!player.world.isRemote) { - EntityThrownItem thrown = new EntityThrownItem(item.world, item.posX, item.posY, item.posZ, (ItemEntity) item); + EntityThrownItem thrown = new EntityThrownItem(item.world, item.getX(), item.getY(), item.getZ(), (ItemEntity) item); item.world.addEntity(thrown); } item.remove(); diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemMissileRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemMissileRod.java index 3549cc537..333a39fe9 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemMissileRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemMissileRod.java @@ -61,11 +61,11 @@ public class ItemMissileRod extends ItemMod implements IManaUsingItem, IAvatarWi PlayerEntity player = (PlayerEntity) living; if(count != getUseDuration(stack) && count % (IManaProficiencyArmor.Helper.hasProficiency(player, stack) ? 1 : 2) == 0 && !player.world.isRemote && ManaItemHandler.requestManaExactForTool(stack, player, COST_PER, false)) { - if(spawnMissile(player.world, player, player.posX + (Math.random() - 0.5 * 0.1), player.posY + 2.4 + (Math.random() - 0.5 * 0.1), player.posZ + (Math.random() - 0.5 * 0.1))) + if(spawnMissile(player.world, player, player.getX() + (Math.random() - 0.5 * 0.1), player.getY() + 2.4 + (Math.random() - 0.5 * 0.1), player.getZ() + (Math.random() - 0.5 * 0.1))) ManaItemHandler.requestManaExactForTool(stack, player, COST_PER, true); SparkleParticleData data = SparkleParticleData.sparkle(6F, 1F, 0.4F, 1F, 6); - player.world.addParticle(data, player.posX, player.posY + 2.4, player.posZ, 0, 0, 0); + player.world.addParticle(data, player.getX(), player.getY() + 2.4, player.getZ(), 0, 0, 0); } } @@ -91,7 +91,7 @@ public class ItemMissileRod extends ItemMod implements IManaUsingItem, IAvatarWi @Override public ActionResult onItemRightClick(World world, PlayerEntity player, @Nonnull Hand hand) { player.setActiveHand(hand); - return ActionResult.newResult(ActionResultType.SUCCESS, player.getHeldItem(hand)); + return ActionResult.success(player.getHeldItem(hand)); } @Override diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemRainbowRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemRainbowRod.java index 7b372dfec..ff479b21d 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemRainbowRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemRainbowRod.java @@ -60,9 +60,9 @@ public class ItemRainbowRod extends ItemMod implements IManaUsingItem, IAvatarWi Block place = ModBlocks.bifrost; Vector3 vector = new Vector3(player.getLookVec()).normalize(); - double x = player.posX; - double y = player.posY; - double z = player.posZ; + double x = player.getX(); + double y = player.getY(); + double z = player.getZ(); BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos((int) x, (int) y, (int) z); double lastX = 0; @@ -112,13 +112,13 @@ public class ItemRainbowRod extends ItemMod implements IManaUsingItem, IAvatarWi } if(count > 0) { - world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.bifrostRod, SoundCategory.PLAYERS, 0.5F, 0.25F); + world.playSound(null, player.getX(), player.getY(), player.getZ(), ModSounds.bifrostRod, SoundCategory.PLAYERS, 0.5F, 0.25F); ManaItemHandler.requestManaExactForTool(stack, player, MANA_COST, false); player.getCooldownTracker().setCooldown(this, TIME); } } - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + return ActionResult.success(stack); } @Nonnull @@ -168,9 +168,9 @@ public class ItemRainbowRod extends ItemMod implements IManaUsingItem, IAvatarWi List players = world.getEntitiesWithinAABB(PlayerEntity.class, axis); for(PlayerEntity p : players) { - int px = MathHelper.floor(p.posX); - int py = MathHelper.floor(p.posY) - 1; - int pz = MathHelper.floor(p.posZ); + int px = MathHelper.floor(p.getX()); + int py = MathHelper.floor(p.getY()) - 1; + int pz = MathHelper.floor(p.getZ()); int dist = 5; int diff = dist / 2; diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemSkyDirtRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemSkyDirtRod.java index 762cdf31b..dd1802f80 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemSkyDirtRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemSkyDirtRod.java @@ -70,7 +70,7 @@ public class ItemSkyDirtRod extends ItemDirtRod { if(world.isRemote) player.swingArm(hand); - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + return ActionResult.success(stack); } } diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemSmeltRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemSmeltRod.java index dee670c90..9106fb65b 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemSmeltRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemSmeltRod.java @@ -68,7 +68,7 @@ public class ItemSmeltRod extends ItemMod implements IManaUsingItem { @Override public ActionResult onItemRightClick(World world, PlayerEntity player, @Nonnull Hand hand) { player.setActiveHand(hand); - return ActionResult.newResult(ActionResultType.SUCCESS, player.getHeldItem(hand)); + return ActionResult.success(player.getHeldItem(hand)); } @Override @@ -106,8 +106,8 @@ public class ItemSmeltRod extends ItemMod implements IManaUsingItem { if(data.progress <= 0) { if(!p.world.isRemote) { p.world.setBlockState(pos.getPos(), Block.getBlockFromItem(result.getItem()).getDefaultState()); - p.world.playSound(null, p.posX, p.posY, p.posZ, SoundEvents.ITEM_FLINTANDSTEEL_USE, SoundCategory.PLAYERS, 0.6F, 1F); - p.world.playSound(null, p.posX, p.posY, p.posZ, SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.PLAYERS, 1F, 1F); + p.world.playSound(null, p.getX(), p.getY(), p.getZ(), SoundEvents.ITEM_FLINTANDSTEEL_USE, SoundCategory.PLAYERS, 0.6F, 1F); + p.world.playSound(null, p.getX(), p.getY(), p.getZ(), SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.PLAYERS, 1F, 1F); ManaItemHandler.requestManaExactForTool(stack, p, COST_PER_TICK, true); playerData.remove(p); @@ -136,7 +136,7 @@ public class ItemSmeltRod extends ItemMod implements IManaUsingItem { p.world.addParticle(data, x, y, z, 0, (float) Math.random() / 10F, 0); } if(time % 10 == 0) - p.world.playSound(null, p.posX, p.posY, p.posZ, SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.PLAYERS, (float) Math.random() / 2F + 0.5F, 1F); + p.world.playSound(null, p.getX(), p.getY(), p.getZ(), SoundEvents.BLOCK_FIRE_AMBIENT, SoundCategory.PLAYERS, (float) Math.random() / 2F + 0.5F, 1F); } } } diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemTerraformRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemTerraformRod.java index 17ed91bf0..1cf829e49 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemTerraformRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemTerraformRod.java @@ -83,7 +83,7 @@ public class ItemTerraformRod extends ItemMod implements IManaUsingItem, IBlockP @Override public ActionResult onItemRightClick(World world, PlayerEntity player, @Nonnull Hand hand) { player.setActiveHand(hand); - return ActionResult.newResult(ActionResultType.SUCCESS, player.getHeldItem(hand)); + return ActionResult.success(player.getHeldItem(hand)); } private void terraform(ItemStack par1ItemStack, World world, PlayerEntity player) { @@ -135,7 +135,7 @@ public class ItemTerraformRod extends ItemMod implements IManaUsingItem, IBlockP if(!blocks.isEmpty()) { for(int i = 0; i < 10; i++) - world.playSound(player, player.posX, player.posY, player.posZ, SoundEvents.BLOCK_SAND_STEP, SoundCategory.BLOCKS, 1F, 0.4F); + world.playSound(player, player.getX(), player.getY(), player.getZ(), SoundEvents.BLOCK_SAND_STEP, SoundCategory.BLOCKS, 1F, 0.4F); SparkleParticleData data = SparkleParticleData.sparkle(2F, 0.35F, 0.2F, 0.05F, 5); for(int i = 0; i < 120; i++) world.addParticle(data, startCenter.getX() - range + range * 2 * Math.random(), startCenter.getY() + 2 + (Math.random() - 0.5) * 2, startCenter.getZ() - range + range * 2 * Math.random(), 0, 0, 0); diff --git a/src/main/java/vazkii/botania/common/item/rod/ItemTornadoRod.java b/src/main/java/vazkii/botania/common/item/rod/ItemTornadoRod.java index 48b16fb2d..ce375013a 100644 --- a/src/main/java/vazkii/botania/common/item/rod/ItemTornadoRod.java +++ b/src/main/java/vazkii/botania/common/item/rod/ItemTornadoRod.java @@ -78,7 +78,7 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi player.playSound(ModSounds.airRod, 0.1F, 0.25F); for(int i = 0; i < 5; i++) { WispParticleData data = WispParticleData.wisp(0.35F + (float) Math.random() * 0.1F, 0.25F, 0.25F, 0.25F); - world.addParticle(data, player.posX, player.posY, player.posZ, 0.2F * (float) (Math.random() - 0.5), -0.01F * (float) Math.random(), 0.2F * (float) (Math.random() - 0.5)); + world.addParticle(data, player.getX(), player.getY(), player.getZ(), 0.2F * (float) (Math.random() - 0.5), -0.01F * (float) Math.random(), 0.2F * (float) (Math.random() - 0.5)); } } @@ -110,10 +110,10 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi if(fly == 0 && ManaItemHandler.requestManaExactForTool(stack, player, COST, false)) { ManaItemHandler.requestManaExactForTool(stack, player, COST, true); setFlying(stack, true); - return ActionResult.newResult(ActionResultType.SUCCESS, stack); + return ActionResult.success(stack); } - return ActionResult.newResult(ActionResultType.PASS, stack); + return ActionResult.pass(stack); } private boolean isFlying(ItemStack stack) { @@ -152,11 +152,11 @@ public class ItemTornadoRod extends ItemMod implements IManaUsingItem, IAvatarWi for(int i = 0; i < 20; i++) for(int j = 0; j < 5; j++) { WispParticleData data = WispParticleData.wisp(0.35F + (float) Math.random() * 0.1F, 0.25F, 0.25F, 0.25F); - world.addParticle(data, p.posX, p.posY + i, p.posZ, 0.2F * (float) (Math.random() - 0.5), -0.01F * (float) Math.random(), 0.2F * (float) (Math.random() - 0.5)); + world.addParticle(data, p.getX(), p.getY() + i, p.getZ(), 0.2F * (float) (Math.random() - 0.5), -0.01F * (float) Math.random(), 0.2F * (float) (Math.random() - 0.5)); } if(!world.isRemote) { - p.world.playSound(null, p.posX, p.posY, p.posZ, ModSounds.dash, SoundCategory.PLAYERS, 1F, 1F); + p.world.playSound(null, p.getX(), p.getY(), p.getZ(), ModSounds.dash, SoundCategory.PLAYERS, 1F, 1F); p.addPotionEffect(new EffectInstance(ModPotions.featherfeet, 100, 0)); tile.recieveMana(-COST); } diff --git a/src/main/java/vazkii/botania/common/network/PacketBotaniaEffect.java b/src/main/java/vazkii/botania/common/network/PacketBotaniaEffect.java index b0e972c26..9e9005203 100644 --- a/src/main/java/vazkii/botania/common/network/PacketBotaniaEffect.java +++ b/src/main/java/vazkii/botania/common/network/PacketBotaniaEffect.java @@ -120,8 +120,8 @@ public class PacketBotaniaEffect { if(e1 == null || e2 == null) return; - Vector3 orig = new Vector3(e1.posX , e1.posY + 0.25, e1.posZ); - Vector3 end = new Vector3(e2.posX, e2.posY + 0.25, e2.posZ); + Vector3 orig = new Vector3(e1.getX() , e1.getY() + 0.25, e1.getZ()); + Vector3 end = new Vector3(e2.getX(), e2.getY() + 0.25, e2.getZ()); Vector3 diff = end.subtract(orig); Vector3 movement = diff.normalize().multiply(0.1); int iters = (int) (diff.mag() / movement.mag()); @@ -233,9 +233,9 @@ public class PacketBotaniaEffect { Entity entity = world.getEntityByID(message.args[0]); if(entity != null) { for(int i = 0; i < 15; i++) { - float x = (float) (entity.posX + Math.random()); - float y = (float) (entity.posY + Math.random()); - float z = (float) (entity.posZ + Math.random()); + float x = (float) (entity.getX() + Math.random()); + float y = (float) (entity.getY() + Math.random()); + float z = (float) (entity.getZ() + Math.random()); WispParticleData data = WispParticleData.wisp((float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 1); world.addParticle(data, x, y, z, 0, -(-0.3F + (float) Math.random() * 0.2F), 0); } @@ -253,9 +253,9 @@ public class PacketBotaniaEffect { if(target == null) break; - double x = target.posX; - double y = target.posY; - double z = target.posZ; + double x = target.getX(); + double y = target.getY(); + double z = target.getZ(); SparkleParticleData data = SparkleParticleData.sparkle(1F, 1F, 1F, 0.25F, 3); for(int i = 0; i < 50; i++) diff --git a/src/main/java/vazkii/botania/common/network/PacketDodge.java b/src/main/java/vazkii/botania/common/network/PacketDodge.java index 02f002ff4..838d6de16 100644 --- a/src/main/java/vazkii/botania/common/network/PacketDodge.java +++ b/src/main/java/vazkii/botania/common/network/PacketDodge.java @@ -34,7 +34,7 @@ public class PacketDodge { public static void handle(PacketDodge msg, Supplier ctx) { ctx.get().enqueueWork(() -> { ServerPlayerEntity player = ctx.get().getSender(); - player.world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.dash, SoundCategory.PLAYERS, 1F, 1F); + player.world.playSound(null, player.getX(), player.getY(), player.getZ(), ModSounds.dash, SoundCategory.PLAYERS, 1F, 1F); ItemStack ringStack = EquipmentHandler.findOrEmpty(ModItems.dodgeRing, player); if(ringStack.isEmpty()) { diff --git a/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java b/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java index e047b6149..28c7f74dd 100644 --- a/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java +++ b/src/main/java/vazkii/botania/common/world/SkyblockWorldEvents.java @@ -164,9 +164,9 @@ public final class SkyblockWorldEvents { if(fabricated) { persist.putBoolean(TAG_HAS_OWN_ISLAND, true); - persist.putDouble(TAG_ISLAND_X, player.posX); - persist.putDouble(TAG_ISLAND_Y, player.posY); - persist.putDouble(TAG_ISLAND_Z, player.posZ); + persist.putDouble(TAG_ISLAND_X, player.getX()); + persist.putDouble(TAG_ISLAND_Y, player.getY()); + persist.putDouble(TAG_ISLAND_Z, player.getZ()); } } else { double posX = persist.getDouble(TAG_ISLAND_X);