mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-16 10:04:42 +00:00
Chest will be done nearer to christmas
This commit is contained in:
1 parent
6c1178edb6
commit
7d41512d43
8 files changed
+124
-114
No files matched your search
@@ -1,34 +1,5 @@
|
||||
package info.jbcs.minecraft.chisel;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import info.jbcs.minecraft.chisel.block.BlockCarvable;
|
||||
import info.jbcs.minecraft.chisel.block.tileentity.TileEntityAutoChisel;
|
||||
import info.jbcs.minecraft.chisel.client.gui.GuiAutoChisel;
|
||||
import info.jbcs.minecraft.chisel.client.gui.GuiChisel;
|
||||
import info.jbcs.minecraft.chisel.compat.Compatibility;
|
||||
import info.jbcs.minecraft.chisel.compat.FMPIntegration;
|
||||
import info.jbcs.minecraft.chisel.compat.ModIntegration;
|
||||
import info.jbcs.minecraft.chisel.init.ModBlocks;
|
||||
import info.jbcs.minecraft.chisel.init.ModItems;
|
||||
import info.jbcs.minecraft.chisel.init.ModTabs;
|
||||
import info.jbcs.minecraft.chisel.inventory.ContainerAutoChisel;
|
||||
import info.jbcs.minecraft.chisel.inventory.ContainerChisel;
|
||||
import info.jbcs.minecraft.chisel.inventory.InventoryChiselSelection;
|
||||
import info.jbcs.minecraft.chisel.proxy.CommonProxy;
|
||||
import info.jbcs.minecraft.chisel.world.GeneratorLimestone;
|
||||
import info.jbcs.minecraft.chisel.world.GeneratorMarble;
|
||||
import info.jbcs.minecraft.chisel.utils.General;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import cpw.mods.fml.client.event.ConfigChangedEvent;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
@@ -36,34 +7,55 @@ import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.event.FMLMissingMappingsEvent;
|
||||
import cpw.mods.fml.common.event.*;
|
||||
import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.Type;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import info.jbcs.minecraft.chisel.block.BlockCarvable;
|
||||
import info.jbcs.minecraft.chisel.block.tileentity.TileEntityAutoChisel;
|
||||
import info.jbcs.minecraft.chisel.block.tileentity.TileEntityPresent;
|
||||
import info.jbcs.minecraft.chisel.client.gui.GuiAutoChisel;
|
||||
import info.jbcs.minecraft.chisel.client.gui.GuiChisel;
|
||||
import info.jbcs.minecraft.chisel.client.gui.GuiPresent;
|
||||
import info.jbcs.minecraft.chisel.compat.Compatibility;
|
||||
import info.jbcs.minecraft.chisel.compat.ModIntegration;
|
||||
import info.jbcs.minecraft.chisel.init.ModBlocks;
|
||||
import info.jbcs.minecraft.chisel.init.ModItems;
|
||||
import info.jbcs.minecraft.chisel.init.ModTabs;
|
||||
import info.jbcs.minecraft.chisel.inventory.ContainerAutoChisel;
|
||||
import info.jbcs.minecraft.chisel.inventory.ContainerChisel;
|
||||
import info.jbcs.minecraft.chisel.inventory.ContainerPresent;
|
||||
import info.jbcs.minecraft.chisel.inventory.InventoryChiselSelection;
|
||||
import info.jbcs.minecraft.chisel.proxy.CommonProxy;
|
||||
import info.jbcs.minecraft.chisel.utils.General;
|
||||
import info.jbcs.minecraft.chisel.world.GeneratorLimestone;
|
||||
import info.jbcs.minecraft.chisel.world.GeneratorMarble;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
||||
@Mod(modid = Chisel.MOD_ID, name = Chisel.MOD_NAME, version = Chisel.VERSION, guiFactory = "info.jbcs.minecraft.chisel.client.gui.GuiFactory", dependencies = "after:ForgeMultipart;")
|
||||
public class Chisel
|
||||
{
|
||||
public static final String MOD_ID = "chisel";
|
||||
public static final BlockCarvable.SoundType soundTempleFootstep = new BlockCarvable.SoundType("dig.stone", MOD_ID + ":step.templeblock", 1.0f, 1.0f);
|
||||
public static final String MOD_NAME = "Chisel 2";
|
||||
public static final String VERSION = "2.0.0.3";
|
||||
|
||||
public static boolean multipartLoaded = false;
|
||||
|
||||
public static final BlockCarvable.SoundType soundHolystoneFootstep = new BlockCarvable.SoundType("holystone", 1.0f, 1.0f);
|
||||
public static final BlockCarvable.SoundType soundTempleFootstep = new BlockCarvable.SoundType("dig.stone", MOD_ID+":step.templeblock", 1.0f, 1.0f);
|
||||
public static final BlockCarvable.SoundType soundMetalFootstep = new BlockCarvable.SoundType("metal", 1.0f, 1.0f);
|
||||
|
||||
|
||||
|
||||
public static boolean multipartLoaded = false;
|
||||
public static int RenderEldritchId;
|
||||
public static int RenderCTMId;
|
||||
public static int RenderCarpetId;
|
||||
@@ -74,38 +66,39 @@ public class Chisel
|
||||
@SidedProxy(clientSide = "info.jbcs.minecraft.chisel.proxy.ClientProxy", serverSide = "info.jbcs.minecraft.chisel.proxy.CommonProxy")
|
||||
public static CommonProxy proxy;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static void initModIntegration() {
|
||||
//To be added back at a different time
|
||||
//ModIntegration.addMod(FMPIntegration.class);
|
||||
|
||||
ModIntegration.init();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void missingMapping(FMLMissingMappingsEvent event)
|
||||
{
|
||||
public void missingMapping(FMLMissingMappingsEvent event) {
|
||||
BlockNameConversion.init();
|
||||
|
||||
for(MissingMapping m : event.get())
|
||||
{
|
||||
for (MissingMapping m : event.get()) {
|
||||
// This bug was introduced along with Chisel 1.5.2, and was fixed in 1.5.3.
|
||||
// Ice Stairs were called null.0-7 instead of other names, and Marble/Limestone stairs did not exist.
|
||||
// This fixes the bug.
|
||||
if(m.name.startsWith("null.") && m.name.length() == 6 && m.type == Type.BLOCK)
|
||||
{
|
||||
if (m.name.startsWith("null.") && m.name.length() == 6 && m.type == Type.BLOCK) {
|
||||
m.warn();//(Action.WARN);
|
||||
}
|
||||
|
||||
// Fix mapping of snakestoneSand, snakestoneStone, limestoneStairs, marbleStairs when loading an old (1.5.4) save
|
||||
else if(m.type == Type.BLOCK)
|
||||
{
|
||||
else if (m.type == Type.BLOCK) {
|
||||
final Block block = BlockNameConversion.findBlock(m.name);
|
||||
|
||||
if(block != null)
|
||||
{
|
||||
if (block != null) {
|
||||
m.remap(block);
|
||||
FMLLog.getLogger().info("Remapping block " + m.name + " to " + General.getName(block));
|
||||
} else
|
||||
FMLLog.getLogger().warn("Block " + m.name + " could not get remapped.");
|
||||
} else if(m.type == Type.ITEM)
|
||||
{
|
||||
} else if (m.type == Type.ITEM) {
|
||||
final Item item = BlockNameConversion.findItem(m.name);
|
||||
|
||||
if(item != null)
|
||||
{
|
||||
if (item != null) {
|
||||
m.remap(item);
|
||||
FMLLog.getLogger().info("Remapping item " + m.name + " to " + General.getName(item));
|
||||
|
||||
@@ -116,8 +109,7 @@ public class Chisel
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
File configFile = event.getSuggestedConfigurationFile();
|
||||
Configurations.configExists = configFile.exists();
|
||||
Configurations.config = new Configuration(configFile);
|
||||
@@ -135,33 +127,38 @@ public class Chisel
|
||||
{
|
||||
Crafting.init();
|
||||
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(this, new IGuiHandler()
|
||||
{
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(this, new IGuiHandler() {
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
switch (ID){
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
switch (ID) {
|
||||
case 0:
|
||||
return new ContainerChisel(player.inventory, new InventoryChiselSelection(null));
|
||||
case 1:
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
if (tileentity instanceof TileEntityAutoChisel)
|
||||
return new ContainerAutoChisel(player.inventory, (TileEntityAutoChisel) tileentity);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
if (tileentity instanceof TileEntityAutoChisel)
|
||||
return new ContainerAutoChisel(player.inventory, (TileEntityAutoChisel) tileentity);
|
||||
case 2:
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
if (tileEntity instanceof TileEntityPresent)
|
||||
return new ContainerPresent(player.inventory, (TileEntityPresent) tileEntity);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||
{
|
||||
switch (ID){
|
||||
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
switch (ID) {
|
||||
case 0:
|
||||
return new GuiChisel(player.inventory, new InventoryChiselSelection(null));
|
||||
case 1:
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
if (tileentity instanceof TileEntityAutoChisel)
|
||||
return new GuiAutoChisel(player.inventory, (TileEntityAutoChisel) tileentity);
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
if (tileentity instanceof TileEntityAutoChisel)
|
||||
return new GuiAutoChisel(player.inventory, (TileEntityAutoChisel) tileentity);
|
||||
case 2:
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
if (tileEntity instanceof TileEntityPresent)
|
||||
return new GuiPresent(player.inventory, (TileEntityPresent) tileEntity);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
@@ -172,7 +169,7 @@ public class Chisel
|
||||
GameRegistry.registerWorldGenerator(new GeneratorMarble(ModBlocks.marble, 32, Configurations.marbleAmount), 1000);
|
||||
GameRegistry.registerWorldGenerator(new GeneratorLimestone(ModBlocks.limestone, 32, Configurations.limestoneAmount), 1000);
|
||||
|
||||
if(event.getSide() == Side.CLIENT){
|
||||
if (event.getSide() == Side.CLIENT) {
|
||||
initModIntegration();
|
||||
}
|
||||
|
||||
@@ -191,22 +188,11 @@ public class Chisel
|
||||
Compatibility.init(event);
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event)
|
||||
{
|
||||
if(event.modID.equals("chisel"))
|
||||
{
|
||||
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) {
|
||||
if (event.modID.equals("chisel")) {
|
||||
Configurations.refreshConfig();
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static void initModIntegration(){
|
||||
//To be added back at a different time
|
||||
//ModIntegration.addMod(FMPIntegration.class);
|
||||
|
||||
ModIntegration.init();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user