fix mappings >_>

This commit is contained in:
Ellpeck 2018-10-13 20:45:32 +02:00
parent 44195137ee
commit 1a099ae221
9 changed files with 35 additions and 50 deletions

View file

@ -29,7 +29,7 @@ minecraft {
// stable_# stables are built at the discretion of the MCP team. // stable_# stables are built at the discretion of the MCP team.
// Use non-default mappings at your own risk. they may not always work. // 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. // 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. // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
replaceIn "NaturesAura.java" replaceIn "NaturesAura.java"

View file

@ -40,7 +40,7 @@ public class BlockContainerImpl extends BlockContainer implements IModItem, IMod
@Nullable @Nullable
@Override @Override
public TileEntity func_149915_a(World world, int meta) { public TileEntity createNewTileEntity(World world, int meta) {
try { try {
return this.tileClass.newInstance(); return this.tileClass.newInstance();
} catch (Exception e) { } catch (Exception e) {

View file

@ -1,9 +1,6 @@
package de.ellpeck.naturesaura.blocks; package de.ellpeck.naturesaura.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
public final class OurBlocks { public final class OurBlocks {
public static final Block TEST_BLOCK = new BlockImpl("test", Material.ANVIL);
} }

View file

@ -18,15 +18,15 @@ public class TileEntityImpl extends TileEntity {
} }
@Override @Override
public NBTTagCompound write(NBTTagCompound compound) { public NBTTagCompound writeToNBT(NBTTagCompound compound) {
this.writeNBT(compound, false); this.writeNBT(compound, false);
return super.write(compound); return super.writeToNBT(compound);
} }
@Override @Override
public void read(NBTTagCompound compound) { public void readFromNBT(NBTTagCompound compound) {
this.readNBT(compound, false); this.readNBT(compound, false);
super.read(compound); super.readFromNBT(compound);
} }
public void writeNBT(NBTTagCompound compound, boolean syncing) { public void writeNBT(NBTTagCompound compound, boolean syncing) {

View file

@ -20,7 +20,7 @@ public class ClientEvents {
@SubscribeEvent @SubscribeEvent
public void onDebugRender(RenderGameOverlayEvent.Text event) { 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 + " "; String prefix = TextFormatting.GREEN + "[" + NaturesAura.MOD_NAME + "]" + TextFormatting.RESET + " ";
List<String> left = event.getLeft(); List<String> left = event.getLeft();
left.add(""); left.add("");
@ -35,12 +35,12 @@ public class ClientEvents {
@SubscribeEvent @SubscribeEvent
public void onTextureStitch(TextureStitchEvent event) { public void onTextureStitch(TextureStitchEvent event) {
event.getMap().func_174942_a(ParticleMagic.TEXTURE); event.getMap().registerSprite(ParticleMagic.TEXTURE);
} }
@SubscribeEvent @SubscribeEvent
public void onClientTick(ClientTickEvent event) { public void onClientTick(ClientTickEvent event) {
Minecraft mc = Minecraft.getInstance(); Minecraft mc = Minecraft.getMinecraft();
if (!mc.isGamePaused()) { if (!mc.isGamePaused()) {
ParticleHandler.updateParticles(); ParticleHandler.updateParticles();
} }

View file

@ -22,27 +22,17 @@ public final class ParticleHandler {
private static final List<Particle> PARTICLES = new ArrayList<>(); private static final List<Particle> PARTICLES = new ArrayList<>();
public static void spawnParticle(Particle particle, double x, double y, double z, int range) { 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); PARTICLES.add(particle);
} }
} }
public static void updateParticles() { public static void updateParticles() {
for (int i = 0; i < PARTICLES.size(); i++) { for (int i = 0; i < PARTICLES.size(); i++) {
boolean remove = false;
Particle particle = PARTICLES.get(i); Particle particle = PARTICLES.get(i);
if (particle != null) { particle.onUpdate();
particle.tick();
if (!particle.isAlive()) { if (!particle.isAlive()) {
remove = true;
}
} else {
remove = true;
}
if (remove) {
PARTICLES.remove(i); PARTICLES.remove(i);
i--; i--;
} }
@ -50,7 +40,7 @@ public final class ParticleHandler {
} }
public static void renderParticles(float partialTicks) { public static void renderParticles(float partialTicks) {
Minecraft mc = Minecraft.getInstance(); Minecraft mc = Minecraft.getMinecraft();
EntityPlayer player = mc.player; EntityPlayer player = mc.player;
if (player != null) { if (player != null) {
@ -67,23 +57,21 @@ public final class ParticleHandler {
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
GlStateManager.enableAlphaTest(); GlStateManager.enableAlpha();
GlStateManager.enableBlend(); GlStateManager.enableBlend();
GlStateManager.alphaFunc(516, 0.003921569F); GlStateManager.alphaFunc(516, 0.003921569F);
GlStateManager.disableCull(); GlStateManager.disableCull();
GlStateManager.depthMask(false); GlStateManager.depthMask(false);
mc.textureManager.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
Tessellator tessy = Tessellator.getInstance(); Tessellator tessy = Tessellator.getInstance();
BufferBuilder buffer = tessy.getBuffer(); BufferBuilder buffer = tessy.getBuffer();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE); GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE);
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP); buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP);
for (Particle particle : PARTICLES) { 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(); tessy.draw();

View file

@ -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) { 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); super(world, posX, posY, posZ);
this.desiredScale = scale; this.desiredScale = scale;
this.maxAge = maxAge; this.particleMaxAge = maxAge;
this.canCollide = collision; this.canCollide = collision;
this.particleGravity = gravity; this.particleGravity = gravity;
@ -27,9 +27,9 @@ public class ParticleMagic extends Particle {
this.motionY = motionY; this.motionY = motionY;
this.motionZ = motionZ; 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.setParticleTexture(map.getAtlasSprite(TEXTURE.toString()));
this.particleAlpha = 0F; this.particleAlpha = 0F;
@ -37,10 +37,10 @@ public class ParticleMagic extends Particle {
} }
@Override @Override
public void tick() { public void onUpdate() {
super.tick(); 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.particleAlpha = 0.75F - (lifeRatio * 0.75F);
this.particleScale = this.desiredScale - (this.desiredScale * lifeRatio); this.particleScale = this.desiredScale - (this.desiredScale * lifeRatio);
} }

View file

@ -39,25 +39,25 @@ public class ClientProxy implements IProxy {
@Override @Override
public void registerRenderer(ItemStack stack, ResourceLocation location, String variant) { 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 @Override
public void addColorProvidingItem(IColorProvidingItem item) { public void addColorProvidingItem(IColorProvidingItem item) {
ItemColors colors = Minecraft.getInstance().getItemColors(); ItemColors colors = Minecraft.getMinecraft().getItemColors();
IItemColor color = item.getItemColor(); IItemColor color = item.getItemColor();
if (item instanceof Item) { if (item instanceof Item) {
colors.func_186730_a(color, (Item) item); colors.registerItemColorHandler(color, (Item) item);
} else if (item instanceof Block) { } else if (item instanceof Block) {
colors.func_186731_a(color, (Block) item); colors.registerItemColorHandler(color, (Block) item);
} }
} }
@Override @Override
public void addColorProvidingBlock(IColorProvidingBlock block) { public void addColorProvidingBlock(IColorProvidingBlock block) {
if (block instanceof 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 @Override
public void scheduleTask(Runnable runnable) { public void scheduleTask(Runnable runnable) {
Minecraft.getInstance().addScheduledTask(runnable); Minecraft.getMinecraft().addScheduledTask(runnable);
} }
} }

View file

@ -24,20 +24,20 @@ public final class ModRegistry {
} }
private static void registerItem(Item item, String name, boolean addCreative) { 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); item.setRegistryName(NaturesAura.MOD_ID, name);
ForgeRegistries.ITEMS.register(item); ForgeRegistries.ITEMS.register(item);
if (addCreative) { if (addCreative) {
item.func_77637_a(NaturesAura.CREATIVE_TAB); item.setCreativeTab(NaturesAura.CREATIVE_TAB);
} else { } else {
item.func_77637_a(null); item.setCreativeTab(null);
} }
} }
private static void registerBlock(Block block, String name, ItemBlock item, boolean addCreative) { 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); block.setRegistryName(NaturesAura.MOD_ID, name);
ForgeRegistries.BLOCKS.register(block); ForgeRegistries.BLOCKS.register(block);
@ -46,9 +46,9 @@ public final class ModRegistry {
ForgeRegistries.ITEMS.register(item); ForgeRegistries.ITEMS.register(item);
if (addCreative) { if (addCreative) {
block.func_149647_a(NaturesAura.CREATIVE_TAB); block.setCreativeTab(NaturesAura.CREATIVE_TAB);
} else { } else {
block.func_149647_a(null); block.setCreativeTab(null);
} }
} }