Skip to content

Commit

Permalink
Properly update for 1.8.9
Browse files Browse the repository at this point in the history
  • Loading branch information
cpw committed Jan 12, 2016
1 parent 3b63013 commit ef1058e
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 17 deletions.
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ archivesBaseName = "ironchest"

// Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here
minecraft {
version = "1.8.8-11.14.4.1576-1.8.8"
mappings = "snapshot_20151122"
version = "1.8.9-11.15.0.1689"
mappings = "stable_20"
runDir = "run"
}

Expand Down Expand Up @@ -76,7 +76,7 @@ uploadArchives {
if (project.hasProperty('forgeMavenPass'))
{
repository(url: "http://files.minecraftforge.net/maven/manage/upload") {
authentication(userName: "forge", password: project.getProperty('forgeMavenPass')) // the elvis operator. look it up.
authentication(userName: project.getProperty('forgeMavenUser'), password: project.getProperty('forgeMavenPassword')) // the elvis operator. look it up.
}
}
else
Expand All @@ -94,7 +94,7 @@ uploadArchives {
name project.archivesBaseName
packaging 'jar'
description 'IronChest'
url 'https://github.com/cpw/IronChest'
url 'https://github.com/progwml6/IronChest'

scm {
url 'https://github.com/progwml6/IronChest'
Expand Down Expand Up @@ -146,7 +146,7 @@ def getGitVersion()
def maj = matcher[0][1]
def min = matcher[0][2]
def rev = matcher[0][3]
def bn = System.getenv("BUILD_NUMBER") ?: "1"
def bn = System.getenv("PROMOTED_NUMBER") ?: System.getenv("BUILD_NUMBER") ?: "1"

out['IronChest.build.major.number'] = maj.toString()
out['IronChest.build.minor.number'] = min.toString()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cpw/mods/ironchest/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void registerRenderInformation()

}

public void registerTileEntitySpecialRenderer(IronChestType typ)
public <T extends TileEntityIronChest> void registerTileEntitySpecialRenderer(Class<T> typ)
{

}
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/cpw/mods/ironchest/ContainerIronChest.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@
******************************************************************************/
package cpw.mods.ironchest;

import invtweaks.api.container.ChestContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;

@ChestContainer(isLargeChest = true)
public class ContainerIronChest extends Container {
private IronChestType type;
private EntityPlayer player;
Expand Down Expand Up @@ -118,7 +116,6 @@ public EntityPlayer getPlayer()
return player;
}

@ChestContainer.RowSizeCallback
public int getNumColumns() {
return type.getRowLength();
}
Expand Down
16 changes: 14 additions & 2 deletions src/main/java/cpw/mods/ironchest/IronChest.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,29 @@
******************************************************************************/
package cpw.mods.ironchest;

import io.netty.buffer.ByteBuf;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderFireball;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.projectile.EntitySmallFireball;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.client.registry.IRenderFactory;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;

@Mod(modid = "IronChest", name = "Iron Chests", dependencies = "required-after:Forge@[11.14.4,]", acceptedMinecraftVersions="[1.8,1.8.8]")
@Mod(modid = "IronChest", name = "Iron Chests", dependencies = "required-after:Forge@[11.15.0,12.0]", acceptedMinecraftVersions="[1.8,1.8.9]")
public class IronChest
{
public static BlockIronChest ironChestBlock;
Expand Down Expand Up @@ -48,7 +60,7 @@ public void load(FMLInitializationEvent evt)
for (IronChestType typ : IronChestType.values())
{
GameRegistry.registerTileEntityWithAlternatives(typ.clazz, "IronChest." + typ.name(), typ.name());
proxy.registerTileEntitySpecialRenderer(typ);
proxy.registerTileEntitySpecialRenderer(typ.clazz);
}
IronChestType.registerBlocksAndRecipes(ironChestBlock);
ChestChangerType.generateRecipes();
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/cpw/mods/ironchest/TileEntityIronChest.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public void setInventorySlotContents(int i, ItemStack itemstack)
}

@Override
public String getCommandSenderName()
public String getName()
{
return this.hasCustomName() ? this.customName : type.name();
}
Expand Down Expand Up @@ -439,6 +439,7 @@ public TileEntityIronChest updateFromMetadata(int l)
@Override
public Packet<?> getDescriptionPacket()
{

NBTTagCompound nbt = new NBTTagCompound();
nbt.setInteger("type", getType().ordinal());
nbt.setByte("facing", facing);
Expand Down Expand Up @@ -524,7 +525,7 @@ public ItemStack[] buildItemStackDataList()
}

@Override
public ItemStack getStackInSlotOnClosing(int par1)
public ItemStack removeStackFromSlot(int par1)
{
if (this.chestContents[par1] != null)
{
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/cpw/mods/ironchest/client/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public void registerRenderInformation()
}

@Override
public void registerTileEntitySpecialRenderer(IronChestType typ)
public <T extends TileEntityIronChest> void registerTileEntitySpecialRenderer(Class<T> type)
{
ClientRegistry.bindTileEntitySpecialRenderer(typ.clazz, new TileEntityIronChestRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(type, new TileEntityIronChestRenderer<T>(type));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;

public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer<TileEntityIronChest>
public class TileEntityIronChestRenderer<T extends TileEntityIronChest> extends TileEntitySpecialRenderer<T>
{
private static Map<IronChestType, ResourceLocation> locations;

Expand All @@ -50,7 +50,7 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer<TileE
private static float[][] shifts = { { 0.3F, 0.45F, 0.3F }, { 0.7F, 0.45F, 0.3F }, { 0.3F, 0.45F, 0.7F }, { 0.7F, 0.45F, 0.7F }, { 0.3F, 0.1F, 0.3F },
{ 0.7F, 0.1F, 0.3F }, { 0.3F, 0.1F, 0.7F }, { 0.7F, 0.1F, 0.7F }, { 0.5F, 0.32F, 0.5F }, };

public TileEntityIronChestRenderer()
public TileEntityIronChestRenderer(Class<T> type)
{
model = new ModelChest();
random = new Random();
Expand Down

0 comments on commit ef1058e

Please sign in to comment.