Fix up stuff- cats are buggy, but i'm working on it.

This commit is contained in:
Christian 2012-08-14 09:40:04 -04:00
parent 8d2a21f082
commit 00b8a500d9
5 changed files with 8 additions and 87 deletions

View File

@ -114,12 +114,6 @@
</antcall> </antcall>
</target> </target>
<target name="merge-server" depends="init,clean">
<antcall target="merge-source">
<param name="side" value="server" />
</antcall>
</target>
<target name="merge-source"> <target name="merge-source">
<side prop="merge-to" src="mcp.srcdir" side="${side}" /> <side prop="merge-to" src="mcp.srcdir" side="${side}" />
<side prop="side-from" src="src.dir" side="${side}" /> <side prop="side-from" src="src.dir" side="${side}" />
@ -136,12 +130,6 @@
</antcall> </antcall>
</target> </target>
<target name="build-server" depends="init,clean,merge-server,buildandreobfmcp">
<antcall target="extract-built-jar">
<param name="side" value="server" />
</antcall>
</target>
<target name="extract-built-jar"> <target name="extract-built-jar">
<side prop="output" src="mcp.obfoutput" side="${side}" /> <side prop="output" src="mcp.obfoutput" side="${side}" />
<property name="jarname" value="${modname}-${side}-${version}" /> <property name="jarname" value="${modname}-${side}-${version}" />
@ -168,7 +156,7 @@
</jar> </jar>
</target> </target>
<target name="build" depends="merge-client,merge-server,build-client,build-server" /> <target name="build" depends="merge-client,build-client" />
<target name="buildandclean" depends="build"> <target name="buildandclean" depends="build">
<antcall target="clean" /> <antcall target="clean" />

View File

@ -35,21 +35,21 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
public class IronChest { public class IronChest {
public static BlockIronChest ironChestBlock; public static BlockIronChest ironChestBlock;
@SidedProxy(clientSide = "cpw.mods.ironchest.client.ClientProxy", serverSide = "cpw.mods.ironchest.common.CommonProxy") @SidedProxy(clientSide = "cpw.mods.ironchest.client.ClientProxy", serverSide = "cpw.mods.ironchest.CommonProxy")
public static CommonProxy proxy; public static CommonProxy proxy;
@Instance @Instance
public static IronChest instance; public static IronChest instance;
public static boolean CACHE_RENDER = true; public static boolean CACHE_RENDER = true;
public static boolean OCELOTS_SITONCHESTS = true; public static boolean OCELOTS_SITONCHESTS = true;
private int blockId;
@PreInit @PreInit
public void preInit(FMLPreInitializationEvent event) { public void preInit(FMLPreInitializationEvent event) {
Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
event.getModMetadata().version = Version.fullVersionString(); event.getModMetadata().version = Version.fullVersionString();
Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());
try { try {
cfg.load(); cfg.load();
int bId = cfg.getOrCreateBlockIdProperty("ironChests", 181).getInt(181); blockId = cfg.getOrCreateBlockIdProperty("ironChests", 181).getInt(181);
ironChestBlock = new BlockIronChest(bId);
ChestChangerType.buildItems(cfg, 29501); ChestChangerType.buildItems(cfg, 29501);
CACHE_RENDER = cfg.getOrCreateBooleanProperty("cacheRenderingInformation", Configuration.CATEGORY_GENERAL, true).getBoolean(true); CACHE_RENDER = cfg.getOrCreateBooleanProperty("cacheRenderingInformation", Configuration.CATEGORY_GENERAL, true).getBoolean(true);
OCELOTS_SITONCHESTS = cfg.getOrCreateBooleanProperty("ocelotsSitOnChests", Configuration.CATEGORY_GENERAL, true).getBoolean(true); OCELOTS_SITONCHESTS = cfg.getOrCreateBooleanProperty("ocelotsSitOnChests", Configuration.CATEGORY_GENERAL, true).getBoolean(true);
@ -62,6 +62,7 @@ public class IronChest {
@Init @Init
public void load(FMLInitializationEvent evt) { public void load(FMLInitializationEvent evt) {
ironChestBlock = new BlockIronChest(blockId);
GameRegistry.registerBlock(ironChestBlock, ItemIronChest.class); GameRegistry.registerBlock(ironChestBlock, ItemIronChest.class);
for (IronChestType typ : IronChestType.values()) { for (IronChestType typ : IronChestType.values()) {
GameRegistry.registerTileEntity(typ.clazz, typ.name()); GameRegistry.registerTileEntity(typ.clazz, typ.name());

View File

@ -2,6 +2,7 @@ package cpw.mods.ironchest;
import java.util.List; import java.util.List;
import net.minecraft.src.EntityAIOcelotSit;
import net.minecraft.src.EntityAITaskEntry; import net.minecraft.src.EntityAITaskEntry;
import net.minecraft.src.EntityOcelot; import net.minecraft.src.EntityOcelot;
import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.ForgeSubscribe;
@ -20,7 +21,7 @@ public class OcelotsSitOnChestsHandler {
for (int i=0; i<tasks.size(); i++) for (int i=0; i<tasks.size(); i++)
{ {
EntityAITaskEntry task = tasks.get(i); EntityAITaskEntry task = tasks.get(i);
if (task.priority == 6 && !(task.action instanceof IronChestAIOcelotSit)) if (task.priority == 6 && (task.action instanceof EntityAIOcelotSit) && !(task.action instanceof IronChestAIOcelotSit))
{ {
task.action = new IronChestAIOcelotSit(ocelot, 0.4F); task.action = new IronChestAIOcelotSit(ocelot, 0.4F);
} }

View File

@ -13,8 +13,6 @@ package cpw.mods.ironchest;
import java.util.Arrays; import java.util.Arrays;
import java.util.Comparator; import java.util.Comparator;
import org.lwjgl.input.Mouse;
import net.minecraft.src.EntityPlayer; import net.minecraft.src.EntityPlayer;
import net.minecraft.src.IInventory; import net.minecraft.src.IInventory;
import net.minecraft.src.ItemStack; import net.minecraft.src.ItemStack;
@ -305,7 +303,6 @@ public class TileEntityIronChest extends TileEntity implements IInventory {
} }
public TileEntityIronChest applyUpgradeItem(ItemChestChanger itemChestChanger) { public TileEntityIronChest applyUpgradeItem(ItemChestChanger itemChestChanger) {
Mouse.setGrabbed(false);
if (numUsingPlayers > 0) { if (numUsingPlayers > 0) {
return null; return null;
} }

View File

@ -1,66 +0,0 @@
/*******************************************************************************
* Copyright (c) 2012 cpw.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*
* Contributors:
* cpw - initial API and implementation
******************************************************************************/
package cpw.mods.ironchest.server;
import java.io.File;
import net.minecraft.src.EntityItem;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.ModLoader;
import net.minecraft.src.NBTTagCompound;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import cpw.mods.ironchest.ContainerIronChestBase;
import cpw.mods.ironchest.IProxy;
import cpw.mods.ironchest.IronChestType;
import cpw.mods.ironchest.TileEntityIronChest;
public class ServerProxy implements IProxy {
@Override
public void registerRenderInformation() {
// NOOP on server
}
@Override
public void registerTileEntities() {
for (IronChestType typ : IronChestType.values()) {
ModLoader.registerTileEntity(typ.clazz, typ.name());
}
}
@Override
public void registerTranslations() {
// NOOP on server
}
@Override
public File getMinecraftDir() {
return new File(".");
}
@Override
public void applyExtraDataToDrops(EntityItem entityitem, NBTTagCompound data) {
entityitem.item.setTagCompound(data);
}
@Override
public boolean isRemote() {
return false;
}
@Override
public World getCurrentWorld() {
// NOOP on server: there's lots
return null;
}
}