From 1a099ae2210f2339e3261cfbfeed7c2fec6fbed9 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 13 Oct 2018 20:45:32 +0200 Subject: [PATCH] fix mappings >_> --- build.gradle | 2 +- .../blocks/BlockContainerImpl.java | 2 +- .../ellpeck/naturesaura/blocks/OurBlocks.java | 5 +--- .../blocks/tiles/TileEntityImpl.java | 8 +++--- .../naturesaura/events/ClientEvents.java | 6 ++--- .../particles/ParticleHandler.java | 26 +++++-------------- .../naturesaura/particles/ParticleMagic.java | 12 ++++----- .../naturesaura/proxy/ClientProxy.java | 12 ++++----- .../ellpeck/naturesaura/reg/ModRegistry.java | 12 ++++----- 9 files changed, 35 insertions(+), 50 deletions(-) diff --git a/build.gradle b/build.gradle index 6d84ee7e..ac995256 100644 --- a/build.gradle +++ b/build.gradle @@ -29,7 +29,7 @@ minecraft { // stable_# stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not always work. // simply re-run your setup task after changing the mappings to update your workspace. - mappings = "snapshot_20181010" + mappings = "snapshot_20180720" // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. replaceIn "NaturesAura.java" diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/BlockContainerImpl.java b/src/main/java/de/ellpeck/naturesaura/blocks/BlockContainerImpl.java index 3ed095b2..514420e3 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/BlockContainerImpl.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/BlockContainerImpl.java @@ -40,7 +40,7 @@ public class BlockContainerImpl extends BlockContainer implements IModItem, IMod @Nullable @Override - public TileEntity func_149915_a(World world, int meta) { + public TileEntity createNewTileEntity(World world, int meta) { try { return this.tileClass.newInstance(); } catch (Exception e) { diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/OurBlocks.java b/src/main/java/de/ellpeck/naturesaura/blocks/OurBlocks.java index 33976944..6219a6e6 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/OurBlocks.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/OurBlocks.java @@ -1,9 +1,6 @@ package de.ellpeck.naturesaura.blocks; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; - public final class OurBlocks { - public static final Block TEST_BLOCK = new BlockImpl("test", Material.ANVIL); + } diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityImpl.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityImpl.java index b0dced7c..779e508e 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityImpl.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityImpl.java @@ -18,15 +18,15 @@ public class TileEntityImpl extends TileEntity { } @Override - public NBTTagCompound write(NBTTagCompound compound) { + public NBTTagCompound writeToNBT(NBTTagCompound compound) { this.writeNBT(compound, false); - return super.write(compound); + return super.writeToNBT(compound); } @Override - public void read(NBTTagCompound compound) { + public void readFromNBT(NBTTagCompound compound) { this.readNBT(compound, false); - super.read(compound); + super.readFromNBT(compound); } public void writeNBT(NBTTagCompound compound, boolean syncing) { diff --git a/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java b/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java index f9525248..262ee538 100644 --- a/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java +++ b/src/main/java/de/ellpeck/naturesaura/events/ClientEvents.java @@ -20,7 +20,7 @@ public class ClientEvents { @SubscribeEvent public void onDebugRender(RenderGameOverlayEvent.Text event) { - if (Minecraft.getInstance().gameSettings.showDebugInfo) { + if (Minecraft.getMinecraft().gameSettings.showDebugInfo) { String prefix = TextFormatting.GREEN + "[" + NaturesAura.MOD_NAME + "]" + TextFormatting.RESET + " "; List left = event.getLeft(); left.add(""); @@ -35,12 +35,12 @@ public class ClientEvents { @SubscribeEvent public void onTextureStitch(TextureStitchEvent event) { - event.getMap().func_174942_a(ParticleMagic.TEXTURE); + event.getMap().registerSprite(ParticleMagic.TEXTURE); } @SubscribeEvent public void onClientTick(ClientTickEvent event) { - Minecraft mc = Minecraft.getInstance(); + Minecraft mc = Minecraft.getMinecraft(); if (!mc.isGamePaused()) { ParticleHandler.updateParticles(); } diff --git a/src/main/java/de/ellpeck/naturesaura/particles/ParticleHandler.java b/src/main/java/de/ellpeck/naturesaura/particles/ParticleHandler.java index 665bf0c7..8b09bd9c 100644 --- a/src/main/java/de/ellpeck/naturesaura/particles/ParticleHandler.java +++ b/src/main/java/de/ellpeck/naturesaura/particles/ParticleHandler.java @@ -22,27 +22,17 @@ public final class ParticleHandler { private static final List PARTICLES = new ArrayList<>(); public static void spawnParticle(Particle particle, double x, double y, double z, int range) { - if (Minecraft.getInstance().player.getDistanceSq(x, y, z) <= range * range) { + if (particle != null && Minecraft.getMinecraft().player.getDistanceSq(x, y, z) <= range * range) { PARTICLES.add(particle); } } public static void updateParticles() { for (int i = 0; i < PARTICLES.size(); i++) { - boolean remove = false; - Particle particle = PARTICLES.get(i); - if (particle != null) { - particle.tick(); + particle.onUpdate(); - if (!particle.isAlive()) { - remove = true; - } - } else { - remove = true; - } - - if (remove) { + if (!particle.isAlive()) { PARTICLES.remove(i); i--; } @@ -50,7 +40,7 @@ public final class ParticleHandler { } public static void renderParticles(float partialTicks) { - Minecraft mc = Minecraft.getInstance(); + Minecraft mc = Minecraft.getMinecraft(); EntityPlayer player = mc.player; if (player != null) { @@ -67,23 +57,21 @@ public final class ParticleHandler { GlStateManager.pushMatrix(); - GlStateManager.enableAlphaTest(); + GlStateManager.enableAlpha(); GlStateManager.enableBlend(); GlStateManager.alphaFunc(516, 0.003921569F); GlStateManager.disableCull(); GlStateManager.depthMask(false); - mc.textureManager.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); + mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); Tessellator tessy = Tessellator.getInstance(); BufferBuilder buffer = tessy.getBuffer(); GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE); buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP); for (Particle particle : PARTICLES) { - if (particle != null) { - particle.renderParticle(buffer, player, partialTicks, x, xz, z, yz, xy); - } + particle.renderParticle(buffer, player, partialTicks, x, xz, z, yz, xy); } tessy.draw(); diff --git a/src/main/java/de/ellpeck/naturesaura/particles/ParticleMagic.java b/src/main/java/de/ellpeck/naturesaura/particles/ParticleMagic.java index 7207c438..507fa105 100644 --- a/src/main/java/de/ellpeck/naturesaura/particles/ParticleMagic.java +++ b/src/main/java/de/ellpeck/naturesaura/particles/ParticleMagic.java @@ -19,7 +19,7 @@ public class ParticleMagic extends Particle { public ParticleMagic(World world, double posX, double posY, double posZ, double motionX, double motionY, double motionZ, int color, float scale, int maxAge, float gravity, boolean collision) { super(world, posX, posY, posZ); this.desiredScale = scale; - this.maxAge = maxAge; + this.particleMaxAge = maxAge; this.canCollide = collision; this.particleGravity = gravity; @@ -27,9 +27,9 @@ public class ParticleMagic extends Particle { this.motionY = motionY; this.motionZ = motionZ; - this.setColor(((color >> 16) & 255) / 255F, ((color >> 8) & 255) / 255F, (color & 255) / 255F); + this.setRBGColorF(((color >> 16) & 255) / 255F, ((color >> 8) & 255) / 255F, (color & 255) / 255F); - TextureMap map = Minecraft.getInstance().getTextureMap(); + TextureMap map = Minecraft.getMinecraft().getTextureMapBlocks(); this.setParticleTexture(map.getAtlasSprite(TEXTURE.toString())); this.particleAlpha = 0F; @@ -37,10 +37,10 @@ public class ParticleMagic extends Particle { } @Override - public void tick() { - super.tick(); + public void onUpdate() { + super.onUpdate(); - float lifeRatio = (float) this.age / (float) this.maxAge; + float lifeRatio = (float) this.particleAge / (float) this.particleMaxAge; this.particleAlpha = 0.75F - (lifeRatio * 0.75F); this.particleScale = this.desiredScale - (this.desiredScale * lifeRatio); } diff --git a/src/main/java/de/ellpeck/naturesaura/proxy/ClientProxy.java b/src/main/java/de/ellpeck/naturesaura/proxy/ClientProxy.java index 28efd9a6..1c5403ee 100644 --- a/src/main/java/de/ellpeck/naturesaura/proxy/ClientProxy.java +++ b/src/main/java/de/ellpeck/naturesaura/proxy/ClientProxy.java @@ -39,25 +39,25 @@ public class ClientProxy implements IProxy { @Override public void registerRenderer(ItemStack stack, ResourceLocation location, String variant) { - ModelLoader.setCustomModelResourceLocation(stack.getItem(), stack.getDamage(), new ModelResourceLocation(location, variant)); + ModelLoader.setCustomModelResourceLocation(stack.getItem(), stack.getItemDamage(), new ModelResourceLocation(location, variant)); } @Override public void addColorProvidingItem(IColorProvidingItem item) { - ItemColors colors = Minecraft.getInstance().getItemColors(); + ItemColors colors = Minecraft.getMinecraft().getItemColors(); IItemColor color = item.getItemColor(); if (item instanceof Item) { - colors.func_186730_a(color, (Item) item); + colors.registerItemColorHandler(color, (Item) item); } else if (item instanceof Block) { - colors.func_186731_a(color, (Block) item); + colors.registerItemColorHandler(color, (Block) item); } } @Override public void addColorProvidingBlock(IColorProvidingBlock block) { if (block instanceof Block) { - Minecraft.getInstance().getBlockColors().register(block.getBlockColor(), (Block) block); + Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler(block.getBlockColor(), (Block) block); } } @@ -69,6 +69,6 @@ public class ClientProxy implements IProxy { @Override public void scheduleTask(Runnable runnable) { - Minecraft.getInstance().addScheduledTask(runnable); + Minecraft.getMinecraft().addScheduledTask(runnable); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/naturesaura/reg/ModRegistry.java b/src/main/java/de/ellpeck/naturesaura/reg/ModRegistry.java index b6a1bf7b..a4b7b6b3 100644 --- a/src/main/java/de/ellpeck/naturesaura/reg/ModRegistry.java +++ b/src/main/java/de/ellpeck/naturesaura/reg/ModRegistry.java @@ -24,20 +24,20 @@ public final class ModRegistry { } private static void registerItem(Item item, String name, boolean addCreative) { - item.func_77655_b(NaturesAura.MOD_ID + "." + name); + item.setTranslationKey(NaturesAura.MOD_ID + "." + name); item.setRegistryName(NaturesAura.MOD_ID, name); ForgeRegistries.ITEMS.register(item); if (addCreative) { - item.func_77637_a(NaturesAura.CREATIVE_TAB); + item.setCreativeTab(NaturesAura.CREATIVE_TAB); } else { - item.func_77637_a(null); + item.setCreativeTab(null); } } private static void registerBlock(Block block, String name, ItemBlock item, boolean addCreative) { - block.func_149663_c(NaturesAura.MOD_ID + "." + name); + block.setTranslationKey(NaturesAura.MOD_ID + "." + name); block.setRegistryName(NaturesAura.MOD_ID, name); ForgeRegistries.BLOCKS.register(block); @@ -46,9 +46,9 @@ public final class ModRegistry { ForgeRegistries.ITEMS.register(item); if (addCreative) { - block.func_149647_a(NaturesAura.CREATIVE_TAB); + block.setCreativeTab(NaturesAura.CREATIVE_TAB); } else { - block.func_149647_a(null); + block.setCreativeTab(null); } }