Properly update for 1.8.9

This commit is contained in:
cpw 2016-01-12 17:27:56 -05:00
parent 3b63013739
commit ef1058e771
7 changed files with 27 additions and 17 deletions

View File

@ -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"
}
@ -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
@ -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'
@ -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()

View File

@ -22,7 +22,7 @@ public class CommonProxy implements IGuiHandler {
}
public void registerTileEntitySpecialRenderer(IronChestType typ)
public <T extends TileEntityIronChest> void registerTileEntitySpecialRenderer(Class<T> typ)
{
}

View File

@ -10,7 +10,6 @@
******************************************************************************/
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;
@ -18,7 +17,6 @@ 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;
@ -118,7 +116,6 @@ public class ContainerIronChest extends Container {
return player;
}
@ChestContainer.RowSizeCallback
public int getNumColumns() {
return type.getRowLength();
}

View File

@ -10,7 +10,14 @@
******************************************************************************/
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;
@ -18,9 +25,14 @@ 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;
@ -48,7 +60,7 @@ public class IronChest
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();

View File

@ -221,7 +221,7 @@ public class TileEntityIronChest extends TileEntityLockable implements ITickable
}
@Override
public String getCommandSenderName()
public String getName()
{
return this.hasCustomName() ? this.customName : type.name();
}
@ -439,6 +439,7 @@ public class TileEntityIronChest extends TileEntityLockable implements ITickable
@Override
public Packet<?> getDescriptionPacket()
{
NBTTagCompound nbt = new NBTTagCompound();
nbt.setInteger("type", getType().ordinal());
nbt.setByte("facing", facing);
@ -524,7 +525,7 @@ public class TileEntityIronChest extends TileEntityLockable implements ITickable
}
@Override
public ItemStack getStackInSlotOnClosing(int par1)
public ItemStack removeStackFromSlot(int par1)
{
if (this.chestContents[par1] != null)
{

View File

@ -46,9 +46,9 @@ public class ClientProxy extends CommonProxy
}
@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

View File

@ -31,7 +31,7 @@ import net.minecraft.entity.item.EntityItem;
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;
@ -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();