mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-10-26 14:24:34 +00:00
humongous spotless apply to make CI happy
This commit is contained in:
1 parent
a0f11f404a
commit
834beb5ac8
114 files changed
+2121
-1858
No files matched your search
@@ -2,12 +2,12 @@ package com.cricketcraft.chisel.api;
|
||||
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import team.chisel.ctmlib.ICTMBlock;
|
||||
import team.chisel.ctmlib.ISubmapManager;
|
||||
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||
|
||||
import team.chisel.ctmlib.ICTMBlock;
|
||||
import team.chisel.ctmlib.ISubmapManager;
|
||||
|
||||
/**
|
||||
* To be implemented on blocks that can be chiseled and need advanced metadata to variation mapping. Currently not very
|
||||
* usable without internal classes.
|
||||
|
||||
@@ -7,8 +7,8 @@ import net.minecraft.util.ChatComponentTranslation;
|
||||
public class Statistics {
|
||||
|
||||
public static StatBase blocksChiseled = (new StatBasic(
|
||||
"stat.blockChiseled",
|
||||
new ChatComponentTranslation("stat.blockChiseled", new Object[0])));
|
||||
"stat.blockChiseled",
|
||||
new ChatComponentTranslation("stat.blockChiseled", new Object[0])));
|
||||
|
||||
public static void init() {
|
||||
blocksChiseled.initIndependentStat();
|
||||
|
||||
@@ -15,8 +15,6 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import team.chisel.ctmlib.ISubmapManager;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselAPIProps;
|
||||
import com.cricketcraft.chisel.api.FMPIMC;
|
||||
import com.cricketcraft.chisel.api.rendering.TextureType;
|
||||
@@ -25,6 +23,7 @@ import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.ctmlib.ISubmapManager;
|
||||
|
||||
public class CarvableHelper {
|
||||
|
||||
@@ -73,7 +72,7 @@ public class CarvableHelper {
|
||||
}
|
||||
|
||||
public void addVariation(String description, int metadata, Block bb, int blockMeta, Material material,
|
||||
String modid) {
|
||||
String modid) {
|
||||
addVariation(description, metadata, null, bb, blockMeta, modid);
|
||||
}
|
||||
|
||||
@@ -82,7 +81,7 @@ public class CarvableHelper {
|
||||
}
|
||||
|
||||
public void addVariation(String description, int metadata, String texture, Block block, int blockMeta,
|
||||
String modid) {
|
||||
String modid) {
|
||||
addVariation(description, metadata, texture, block, blockMeta, modid, null, metadata);
|
||||
}
|
||||
|
||||
@@ -91,12 +90,13 @@ public class CarvableHelper {
|
||||
}
|
||||
|
||||
public void addVariation(String description, int metadata, String texture, Block block, int blockMeta, String modid,
|
||||
ISubmapManager customManager, int order) {
|
||||
ISubmapManager customManager, int order) {
|
||||
|
||||
if (infoList.size() >= 16) return;
|
||||
|
||||
IVariationInfo info = FMLCommonHandler.instance().getSide().isClient()
|
||||
? getClientInfo(modid, texture, description, metadata, block, blockMeta, customManager, order)
|
||||
IVariationInfo info = FMLCommonHandler.instance()
|
||||
.getSide()
|
||||
.isClient() ? getClientInfo(modid, texture, description, metadata, block, blockMeta, customManager, order)
|
||||
: getServerInfo(modid, texture, description, metadata, block, blockMeta, customManager, order);
|
||||
|
||||
infoList.add(info);
|
||||
@@ -104,12 +104,12 @@ public class CarvableHelper {
|
||||
}
|
||||
|
||||
private IVariationInfo getClientInfo(String modid, String texture, String description, int metadata, Block block,
|
||||
int blockMeta, ISubmapManager customManager, int order) {
|
||||
int blockMeta, ISubmapManager customManager, int order) {
|
||||
ICarvingVariation var = CarvingUtils.getDefaultVariationFor(getBlock(), metadata, order);
|
||||
TextureType type = TextureType.getTypeFor(this, modid, texture);
|
||||
if (type == TextureType.CUSTOM && customManager == null && block == null) {
|
||||
throw new IllegalArgumentException(
|
||||
String.format("Could not find texture %s, and no custom texture manager was provided.", texture));
|
||||
String.format("Could not find texture %s, and no custom texture manager was provided.", texture));
|
||||
}
|
||||
|
||||
ISubmapManager manager;
|
||||
@@ -124,7 +124,7 @@ public class CarvableHelper {
|
||||
}
|
||||
|
||||
private IVariationInfo getServerInfo(String modid, String texture, String description, int metadata, Block block,
|
||||
int blockMeta, ISubmapManager customManager, int order) {
|
||||
int blockMeta, ISubmapManager customManager, int order) {
|
||||
ICarvingVariation var = CarvingUtils.getDefaultVariationFor(getBlock(), metadata, order);
|
||||
return new VariationInfoBase(var, description, null);
|
||||
}
|
||||
@@ -184,15 +184,20 @@ public class CarvableHelper {
|
||||
|
||||
public void registerVariation(String name, IVariationInfo info) {
|
||||
|
||||
Block block = info.getVariation().getBlock();
|
||||
Block block = info.getVariation()
|
||||
.getBlock();
|
||||
|
||||
if (block.renderAsNormalBlock() || block.isOpaqueCube() || block.isNormalCube()) {
|
||||
FMPIMC.registerFMP(block, info.getVariation().getBlockMeta());
|
||||
FMPIMC.registerFMP(
|
||||
block,
|
||||
info.getVariation()
|
||||
.getBlockMeta());
|
||||
}
|
||||
|
||||
if (forbidChiseling) return;
|
||||
|
||||
CarvingUtils.getChiselRegistry().addVariation(name, info.getVariation());
|
||||
CarvingUtils.getChiselRegistry()
|
||||
.addVariation(name, info.getVariation());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -204,7 +209,12 @@ public class CarvableHelper {
|
||||
|
||||
public void registerSubBlocks(Block block, CreativeTabs tabs, List<ItemStack> list) {
|
||||
for (IVariationInfo info : infoList) {
|
||||
list.add(new ItemStack(block, 1, info.getVariation().getItemMeta()));
|
||||
list.add(
|
||||
new ItemStack(
|
||||
block,
|
||||
1,
|
||||
info.getVariation()
|
||||
.getItemMeta()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,8 +224,9 @@ public class CarvableHelper {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getMissingIcon() {
|
||||
return ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture))
|
||||
.getAtlasSprite("missingno");
|
||||
return ((TextureMap) Minecraft.getMinecraft()
|
||||
.getTextureManager()
|
||||
.getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno");
|
||||
}
|
||||
|
||||
public Block getBlock() {
|
||||
|
||||
@@ -10,7 +10,7 @@ public interface IChiselMode {
|
||||
* NOTE: This method is responsible for increasing the "Blocks Chiseled" statistic found in the Statistics class.
|
||||
*/
|
||||
void chiselAll(EntityPlayer player, World world, int x, int y, int z, ForgeDirection side,
|
||||
ICarvingVariation variation);
|
||||
ICarvingVariation variation);
|
||||
|
||||
/**
|
||||
* Implemented implicitly by enums. If your IChiselMode is not an enum constant, this needs to be implemented
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.cricketcraft.chisel.api.carving;
|
||||
|
||||
import team.chisel.ctmlib.ISubmapManager;
|
||||
|
||||
import com.cricketcraft.chisel.api.rendering.TextureType;
|
||||
|
||||
import team.chisel.ctmlib.ISubmapManager;
|
||||
|
||||
public interface IVariationInfo extends ISubmapManager {
|
||||
|
||||
ICarvingVariation getVariation();
|
||||
|
||||
@@ -8,10 +8,10 @@ import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import team.chisel.ctmlib.ISubmapManager;
|
||||
|
||||
import com.cricketcraft.chisel.api.rendering.TextureType;
|
||||
|
||||
import team.chisel.ctmlib.ISubmapManager;
|
||||
|
||||
public class VariationInfoBase implements IVariationInfo {
|
||||
|
||||
private ICarvingVariation variation;
|
||||
|
||||
@@ -2,4 +2,5 @@
|
||||
package com.cricketcraft.chisel.api.carving;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselAPIProps;
|
||||
|
||||
import cpw.mods.fml.common.API;
|
||||
@@ -15,17 +15,16 @@ import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.commons.lang3.tuple.Triple;
|
||||
|
||||
import team.chisel.ctmlib.CTM;
|
||||
import team.chisel.ctmlib.ISubmapManager;
|
||||
import team.chisel.ctmlib.RenderBlocksCTM;
|
||||
import team.chisel.ctmlib.RenderBlocksColumn;
|
||||
import team.chisel.ctmlib.TextureSubmap;
|
||||
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.ctmlib.CTM;
|
||||
import team.chisel.ctmlib.ISubmapManager;
|
||||
import team.chisel.ctmlib.RenderBlocksCTM;
|
||||
import team.chisel.ctmlib.RenderBlocksColumn;
|
||||
import team.chisel.ctmlib.TextureSubmap;
|
||||
|
||||
/**
|
||||
* Handles all default {@link ISubmapManager} behavior
|
||||
|
||||
@@ -2,4 +2,5 @@
|
||||
package com.cricketcraft.chisel.api.rendering;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselAPIProps;
|
||||
|
||||
import cpw.mods.fml.common.API;
|
||||
@@ -5,9 +5,9 @@ import java.util.HashMap;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import team.chisel.utils.General;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import team.chisel.utils.General;
|
||||
|
||||
public class BlockNameConversion {
|
||||
|
||||
@@ -30,7 +30,8 @@ public class BlockNameConversion {
|
||||
return newname;
|
||||
case 2: // rename "marbleSlab" -> "marble_slab", "redstone" ->
|
||||
// "redstone_block"
|
||||
newname = oldname.replaceAll("([a-z]+)([A-Z])", "$1_$2").toLowerCase();
|
||||
newname = oldname.replaceAll("([a-z]+)([A-Z])", "$1_$2")
|
||||
.toLowerCase();
|
||||
|
||||
if (newname.startsWith("block_")) {
|
||||
newname = newname.replaceFirst("block_([a-z_]+)", "$1_block");
|
||||
@@ -39,7 +40,9 @@ public class BlockNameConversion {
|
||||
}
|
||||
return newname;
|
||||
case 3: // rename "wood-dark-oak" -> "dark_oak_planks"
|
||||
newname = oldname.replaceAll("([a-z]+)([A-Z])", "$1_$2").toLowerCase().replace('-', '_');
|
||||
newname = oldname.replaceAll("([a-z]+)([A-Z])", "$1_$2")
|
||||
.toLowerCase()
|
||||
.replace('-', '_');
|
||||
if (newname.contains("wood_")) {
|
||||
newname = newname.replaceFirst("wood_([a-z_]+)", "$1_planks");
|
||||
}
|
||||
@@ -48,7 +51,9 @@ public class BlockNameConversion {
|
||||
// "dirt" -> "dirt").
|
||||
// This can be dangerous in cases like "carpet" (a block) ->
|
||||
// "carpet" (NO block)
|
||||
return oldname.replaceAll("([a-z]+)([A-Z])", "$1_$2").toLowerCase().replaceFirst("block_", "");
|
||||
return oldname.replaceAll("([a-z]+)([A-Z])", "$1_$2")
|
||||
.toLowerCase()
|
||||
.replaceFirst("block_", "");
|
||||
default:
|
||||
throw new IndexOutOfBoundsException("conversion got invalid parameter step=" + step);
|
||||
}
|
||||
@@ -86,11 +91,12 @@ public class BlockNameConversion {
|
||||
}
|
||||
|
||||
public static Item findItem(String oldname) {
|
||||
FMLLog.getLogger().trace("[Chisel 2] findItem() START " + oldname);
|
||||
FMLLog.getLogger()
|
||||
.trace("[Chisel 2] findItem() START " + oldname);
|
||||
Item item = null;
|
||||
for (int i = 0; i < NameConversions.MAX && item == null; i++) {
|
||||
FMLLog.getLogger()
|
||||
.trace("[Chisel 2] findItem() Checking for " + NameConversions.conversion(oldname, i));
|
||||
.trace("[Chisel 2] findItem() Checking for " + NameConversions.conversion(oldname, i));
|
||||
item = GameRegistry.findItem(Chisel.MOD_ID, NameConversions.conversion(oldname, i));
|
||||
}
|
||||
|
||||
@@ -98,11 +104,12 @@ public class BlockNameConversion {
|
||||
}
|
||||
|
||||
public static Block findBlock(String oldname) {
|
||||
FMLLog.getLogger().trace("[Chisel 2] findBlock() START: " + oldname);
|
||||
FMLLog.getLogger()
|
||||
.trace("[Chisel 2] findBlock() START: " + oldname);
|
||||
Block block = null;
|
||||
for (int i = 0; i < NameConversions.MAX && block == null; i++) {
|
||||
FMLLog.getLogger()
|
||||
.trace("[Chisel 2] findBlock() Checking for " + NameConversions.conversion(oldname, i));
|
||||
.trace("[Chisel 2] findBlock() Checking for " + NameConversions.conversion(oldname, i));
|
||||
block = GameRegistry.findBlock(Chisel.MOD_ID, NameConversions.conversion(oldname, i));
|
||||
}
|
||||
|
||||
|
||||
@@ -10,23 +10,6 @@ import net.minecraftforge.common.config.Configuration;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import team.chisel.block.BlockCarvable;
|
||||
import team.chisel.carving.Carving;
|
||||
import team.chisel.compat.Compatibility;
|
||||
import team.chisel.compat.IMCHandler;
|
||||
import team.chisel.compat.fmp.FMPCompat;
|
||||
import team.chisel.config.Configurations;
|
||||
import team.chisel.entity.EntityChiselSnowman;
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
import team.chisel.init.TabsInit;
|
||||
import team.chisel.item.ItemCarvable;
|
||||
import team.chisel.item.chisel.ChiselController;
|
||||
import team.chisel.network.ChiselGuiHandler;
|
||||
import team.chisel.network.PacketHandler;
|
||||
import team.chisel.proxy.CommonProxy;
|
||||
import team.chisel.utils.General;
|
||||
import team.chisel.world.GeneratorChisel;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselAPIProps;
|
||||
import com.cricketcraft.chisel.api.Statistics;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
@@ -52,27 +35,43 @@ import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.Type;
|
||||
import team.chisel.block.BlockCarvable;
|
||||
import team.chisel.carving.Carving;
|
||||
import team.chisel.compat.Compatibility;
|
||||
import team.chisel.compat.IMCHandler;
|
||||
import team.chisel.compat.fmp.FMPCompat;
|
||||
import team.chisel.config.Configurations;
|
||||
import team.chisel.entity.EntityChiselSnowman;
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
import team.chisel.init.TabsInit;
|
||||
import team.chisel.item.ItemCarvable;
|
||||
import team.chisel.item.chisel.ChiselController;
|
||||
import team.chisel.network.ChiselGuiHandler;
|
||||
import team.chisel.network.PacketHandler;
|
||||
import team.chisel.proxy.CommonProxy;
|
||||
import team.chisel.utils.General;
|
||||
import team.chisel.world.GeneratorChisel;
|
||||
|
||||
@Mod(
|
||||
modid = Chisel.MOD_ID,
|
||||
name = Chisel.MOD_NAME,
|
||||
version = Chisel.VERSION,
|
||||
guiFactory = "team.chisel.client.gui.GuiFactory",
|
||||
dependencies = "after:EE3;after:ForgeMultipart;after:Thaumcraft;after:appliedenergistics2;after:Railcraft;after:AWWayofTime;after:TwilightForest")
|
||||
modid = Chisel.MOD_ID,
|
||||
name = Chisel.MOD_NAME,
|
||||
version = Chisel.VERSION,
|
||||
guiFactory = "team.chisel.client.gui.GuiFactory",
|
||||
dependencies = "after:EE3;after:ForgeMultipart;after:Thaumcraft;after:appliedenergistics2;after:Railcraft;after:AWWayofTime;after:TwilightForest")
|
||||
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);
|
||||
"dig.stone",
|
||||
MOD_ID + ":step.templeblock",
|
||||
1.0f,
|
||||
1.0f);
|
||||
public static final String MOD_NAME = "Chisel";
|
||||
public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||
public static final BlockCarvable.SoundType soundHolystoneFootstep = new BlockCarvable.SoundType(
|
||||
"holystone",
|
||||
1.0f,
|
||||
1.0f);
|
||||
"holystone",
|
||||
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 boolean gtnhLoaded = false;
|
||||
@@ -117,23 +116,28 @@ public class Chisel {
|
||||
|
||||
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.");
|
||||
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) {
|
||||
final Item item = BlockNameConversion.findItem(m.name);
|
||||
|
||||
if (item != null) {
|
||||
m.remap(item);
|
||||
FMLLog.getLogger().info("Remapping item " + m.name + " to " + General.getName(item));
|
||||
FMLLog.getLogger()
|
||||
.info("Remapping item " + m.name + " to " + General.getName(item));
|
||||
|
||||
} else FMLLog.getLogger().warn("Item " + m.name + " could not get remapped.");
|
||||
} else FMLLog.getLogger()
|
||||
.warn("Item " + m.name + " could not get remapped.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
FMLCommonHandler.instance().registerCrashCallable(new ChiselCrashCallable());
|
||||
FMLCommonHandler.instance()
|
||||
.registerCrashCallable(new ChiselCrashCallable());
|
||||
|
||||
File configFile = event.getSuggestedConfigurationFile();
|
||||
Configurations.configExists = configFile.exists();
|
||||
@@ -172,7 +176,9 @@ public class Chisel {
|
||||
|
||||
proxy.init();
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
FMLCommonHandler.instance().bus().register(instance);
|
||||
FMLCommonHandler.instance()
|
||||
.bus()
|
||||
.register(instance);
|
||||
|
||||
FMLInterModComms.sendMessage("Waila", "register", "team.chisel.compat.WailaCompat.register");
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ public class ChiselCrashCallable implements ICrashCallable {
|
||||
@Override
|
||||
public String call() throws Exception {
|
||||
return "Errors like \"[FML]: Unable to lookup ...\" are NOT the cause of this crash. "
|
||||
+ "You can safely ignore these errors. And update forge while you're at it.";
|
||||
+ "You can safely ignore these errors. And update forge while you're at it.";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1181
-1018
File diff suppressed because it is too large.
Load diff
@@ -36,7 +36,7 @@ public class BlockAutoChisel extends BlockContainer {
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int metadata, float x1,
|
||||
float y1, float z1) {
|
||||
float y1, float z1) {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (world.isRemote) return true;
|
||||
|
||||
|
||||
@@ -11,9 +11,6 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.config.Configurations;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
@@ -22,6 +19,8 @@ import com.cricketcraft.chisel.api.rendering.ClientUtils;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.config.Configurations;
|
||||
|
||||
public class BlockCarvable extends Block implements ICarvable {
|
||||
|
||||
@@ -145,7 +144,7 @@ public class BlockCarvable extends Block implements ICarvable {
|
||||
* @param frequency default 1.0f
|
||||
*/
|
||||
public SoundType(String soundNameBreak, String soundNameStep, String soundNamePlace, float volume,
|
||||
float frequency) {
|
||||
float frequency) {
|
||||
super(soundNameStep, volume, frequency);
|
||||
this.soundNameStep = soundNameStep;
|
||||
this.soundNameBreak = soundNameBreak;
|
||||
|
||||
@@ -13,14 +13,14 @@ import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.block.tileentity.TileEntityCarvableBeacon;
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||
|
||||
import team.chisel.block.tileentity.TileEntityCarvableBeacon;
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
|
||||
public class BlockCarvableBeacon extends BlockBeacon implements ICarvable {
|
||||
|
||||
public static int renderId;
|
||||
@@ -42,7 +42,7 @@ public class BlockCarvableBeacon extends BlockBeacon implements ICarvable {
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par5, float hitX,
|
||||
float hitY, float hitZ) {
|
||||
float hitY, float hitZ) {
|
||||
if (world.isRemote) {
|
||||
return true;
|
||||
} else {
|
||||
|
||||
@@ -12,8 +12,6 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import team.chisel.ctmlib.CTM;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
@@ -22,6 +20,7 @@ import com.cricketcraft.chisel.api.rendering.ClientUtils;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.ctmlib.CTM;
|
||||
|
||||
public class BlockCarvableGlass extends BlockGlass implements ICarvable {
|
||||
|
||||
@@ -63,7 +62,8 @@ public class BlockCarvableGlass extends BlockGlass implements ICarvable {
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
ForgeDirection face = ForgeDirection.getOrientation(side).getOpposite();
|
||||
ForgeDirection face = ForgeDirection.getOrientation(side)
|
||||
.getOpposite();
|
||||
int meX = x + face.offsetX;
|
||||
int meY = y + face.offsetY;
|
||||
int meZ = z + face.offsetZ;
|
||||
|
||||
@@ -4,10 +4,10 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.client.render.SubmapManagerBase;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.client.render.SubmapManagerBase;
|
||||
|
||||
public class BlockCarvableGlow extends BlockCarvableColor {
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
|
||||
public class BlockCarvableIceStairs extends BlockCarvableStairs {
|
||||
|
||||
public BlockCarvableIceStairs(Block block, int meta, CarvableHelper helper) {
|
||||
|
||||
@@ -4,9 +4,9 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.Chisel;
|
||||
|
||||
public class BlockCarvableLayered extends BlockCarvable {
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
|
||||
public class BlockCarvablePackedIceStairs extends BlockCarvableStairs {
|
||||
|
||||
public BlockCarvablePackedIceStairs(Block block, int meta, CarvableHelper helper) {
|
||||
|
||||
@@ -10,8 +10,6 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import team.chisel.client.render.RendererCTMPane;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
@@ -19,6 +17,7 @@ import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.client.render.RendererCTMPane;
|
||||
|
||||
public class BlockCarvablePane extends BlockPane implements ICarvable {
|
||||
|
||||
|
||||
@@ -10,15 +10,14 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.entity.EntityChiselSnowman;
|
||||
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.entity.EntityChiselSnowman;
|
||||
|
||||
public class BlockCarvablePumpkin extends BlockPumpkin implements ICarvable {
|
||||
|
||||
@@ -58,20 +57,20 @@ public class BlockCarvablePumpkin extends BlockPumpkin implements ICarvable {
|
||||
// Spawn some lovely particles
|
||||
for (int c = 0; c < 120; ++c) {
|
||||
world.spawnParticle(
|
||||
"snowshovel",
|
||||
x + world.rand.nextDouble(),
|
||||
y - 2 + world.rand.nextDouble() * 2.5D,
|
||||
z + world.rand.nextDouble(),
|
||||
0.0D,
|
||||
0.0D,
|
||||
0.0D);
|
||||
"snowshovel",
|
||||
x + world.rand.nextDouble(),
|
||||
y - 2 + world.rand.nextDouble() * 2.5D,
|
||||
z + world.rand.nextDouble(),
|
||||
0.0D,
|
||||
0.0D,
|
||||
0.0D);
|
||||
}
|
||||
} else
|
||||
if (world.getBlock(x, y - 1, z) == Blocks.iron_block || world.getBlock(x, y - 2, z) == Blocks.iron_block) {
|
||||
boolean flag = world.getBlock(x - 1, y - 1, z) == Blocks.iron_block
|
||||
&& world.getBlock(x + 1, y - 1, z) == Blocks.iron_block;
|
||||
&& world.getBlock(x + 1, y - 1, z) == Blocks.iron_block;
|
||||
boolean flag1 = world.getBlock(x, y - 1, z - 1) == Blocks.iron_block
|
||||
&& world.getBlock(x, y - 1, z + 1) == Blocks.iron_block;
|
||||
&& world.getBlock(x, y - 1, z + 1) == Blocks.iron_block;
|
||||
|
||||
if (flag || flag1) {
|
||||
world.setBlock(x, y, z, Blocks.air, 0, 2);
|
||||
@@ -110,11 +109,10 @@ public class BlockCarvablePumpkin extends BlockPumpkin implements ICarvable {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return side == 1 ? top
|
||||
: (side == 0 ? top
|
||||
: (meta == 2 && side == 2 ? face
|
||||
: (meta == 3 && side == 5 ? face
|
||||
: (meta == 0 && side == 3 ? face
|
||||
: (meta == 1 && side == 4 ? face : this.blockIcon)))));
|
||||
: (side == 0 ? top
|
||||
: (meta == 2 && side == 2 ? face
|
||||
: (meta == 3 && side == 5 ? face
|
||||
: (meta == 0 && side == 3 ? face : (meta == 1 && side == 4 ? face : this.blockIcon)))));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,8 +10,6 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
@@ -20,6 +18,7 @@ import com.cricketcraft.chisel.api.rendering.ClientUtils;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.Chisel;
|
||||
|
||||
public class BlockCarvableSand extends BlockSand implements ICarvable {
|
||||
|
||||
@@ -133,7 +132,7 @@ public class BlockCarvableSand extends BlockSand implements ICarvable {
|
||||
* @param frequency default 1.0f
|
||||
*/
|
||||
public SoundType(String soundNameBreak, String soundNameStep, String soundNamePlace, float volume,
|
||||
float frequency) {
|
||||
float frequency) {
|
||||
super(soundNameStep, volume, frequency);
|
||||
this.soundNameStep = soundNameStep;
|
||||
this.soundNameBreak = soundNameBreak;
|
||||
|
||||
@@ -75,7 +75,7 @@ public class BlockCarvableSlab extends BlockCarvable {
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB,
|
||||
List par6List, Entity par7Entity) {
|
||||
List par6List, Entity par7Entity) {
|
||||
setBlockBoundsBasedOnState(par1World, par2, par3, par4);
|
||||
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
|
||||
}
|
||||
|
||||
@@ -14,12 +14,12 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.client.render.RendererStairs;
|
||||
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||
|
||||
import team.chisel.client.render.RendererStairs;
|
||||
|
||||
public class BlockCarvableStairs extends BlockStairs implements ICarvable {
|
||||
|
||||
CarvableHelper carverHelper;
|
||||
@@ -62,7 +62,7 @@ public class BlockCarvableStairs extends BlockStairs implements ICarvable {
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLiving,
|
||||
ItemStack par6ItemStack) {
|
||||
ItemStack par6ItemStack) {
|
||||
int meta = MathHelper.floor_double((par5EntityLiving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||
|
||||
// 0->2 2->3 3->0 1->1
|
||||
|
||||
@@ -7,8 +7,6 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
@@ -16,6 +14,7 @@ import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.Chisel;
|
||||
|
||||
public class BlockCarvableTorch extends BlockTorch implements ICarvable {
|
||||
|
||||
@@ -57,7 +56,7 @@ public class BlockCarvableTorch extends BlockTorch implements ICarvable {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World p_149734_1_, int p_149734_2_, int p_149734_3_, int p_149734_4_,
|
||||
Random p_149734_5_) {
|
||||
Random p_149734_5_) {
|
||||
if (emitsParticles) {
|
||||
int l = p_149734_1_.getBlockMetadata(p_149734_2_, p_149734_3_, p_149734_4_);
|
||||
double d0 = p_149734_2_ + 0.5F;
|
||||
|
||||
@@ -10,9 +10,9 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.config.Configurations;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.config.Configurations;
|
||||
|
||||
public class BlockCloud extends BlockCarvable {
|
||||
|
||||
|
||||
@@ -7,19 +7,21 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovementInput;
|
||||
import net.minecraft.util.MovementInputFromOptions;
|
||||
|
||||
import team.chisel.config.Configurations;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.config.Configurations;
|
||||
|
||||
public class BlockConcrete extends BlockCarvable {
|
||||
|
||||
public BlockConcrete() {
|
||||
super();
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
FMLCommonHandler.instance()
|
||||
.bus()
|
||||
.register(this);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -29,16 +31,16 @@ public class BlockConcrete extends BlockCarvable {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void speedupPlayer(PlayerTickEvent event) {
|
||||
if (event.phase == Phase.START && event.side.isClient()
|
||||
&& event.player.onGround
|
||||
&& event.player instanceof EntityPlayerSP) {
|
||||
&& event.player.onGround
|
||||
&& event.player instanceof EntityPlayerSP) {
|
||||
if (manualInputCheck == null) {
|
||||
manualInputCheck = new MovementInputFromOptions(Minecraft.getMinecraft().gameSettings);
|
||||
}
|
||||
EntityPlayerSP player = (EntityPlayerSP) event.player;
|
||||
Block below = player.worldObj.getBlock(
|
||||
MathHelper.floor_double(player.posX),
|
||||
MathHelper.floor_double(player.posY) - 2,
|
||||
MathHelper.floor_double(player.posZ));
|
||||
MathHelper.floor_double(player.posX),
|
||||
MathHelper.floor_double(player.posY) - 2,
|
||||
MathHelper.floor_double(player.posZ));
|
||||
if (below == this) {
|
||||
manualInputCheck.updatePlayerMoveState();
|
||||
if (manualInputCheck.moveForward != 0 || manualInputCheck.moveStrafe != 0) {
|
||||
|
||||
@@ -19,15 +19,14 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.block.tileentity.TileEntityPresent;
|
||||
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.block.tileentity.TileEntityPresent;
|
||||
|
||||
public class BlockPresent extends Block implements ICarvable {
|
||||
|
||||
@@ -110,7 +109,7 @@ public class BlockPresent extends Block implements ICarvable {
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int hitX, float hitY,
|
||||
float hitZ, float p_149727_9_) {
|
||||
float hitZ, float p_149727_9_) {
|
||||
if (!world.isSideSolid(x, y + 1, z, ForgeDirection.DOWN)) {
|
||||
if (!world.isRemote) {
|
||||
player.openGui(Chisel.instance, 2, world, x, y, z);
|
||||
@@ -143,22 +142,22 @@ public class BlockPresent extends Block implements ICarvable {
|
||||
ForgeDirection dir = me.getConnectionDir();
|
||||
// warning: magic below! Do not change this conditional
|
||||
if (dir == ForgeDirection.EAST || (me.isParent() && dir == ForgeDirection.SOUTH)
|
||||
|| (!me.isParent() && dir == ForgeDirection.SOUTH)) {
|
||||
|| (!me.isParent() && dir == ForgeDirection.SOUTH)) {
|
||||
return AxisAlignedBB.getBoundingBox(
|
||||
x + minX,
|
||||
y + minY,
|
||||
z + minZ,
|
||||
x + maxX + dir.offsetX,
|
||||
y + maxY,
|
||||
z + maxZ + dir.offsetZ);
|
||||
x + minX,
|
||||
y + minY,
|
||||
z + minZ,
|
||||
x + maxX + dir.offsetX,
|
||||
y + maxY,
|
||||
z + maxZ + dir.offsetZ);
|
||||
} else {
|
||||
return AxisAlignedBB.getBoundingBox(
|
||||
x + dir.offsetX + minX,
|
||||
y + minY,
|
||||
z + dir.offsetZ + minZ,
|
||||
x + maxX,
|
||||
y + maxY,
|
||||
z + maxZ);
|
||||
x + dir.offsetX + minX,
|
||||
y + minY,
|
||||
z + dir.offsetZ + minZ,
|
||||
x + maxX,
|
||||
y + maxY,
|
||||
z + maxZ);
|
||||
}
|
||||
}
|
||||
return AxisAlignedBB.getBoundingBox(x + minX, y + minY, z + minZ, x + maxX, y + maxY, z + maxZ);
|
||||
|
||||
@@ -9,10 +9,10 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.config.Configurations;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.config.Configurations;
|
||||
|
||||
public class BlockRoadLine extends BlockCarvable {
|
||||
|
||||
@@ -53,7 +53,8 @@ public class BlockRoadLine extends BlockCarvable {
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) {
|
||||
return World.doesBlockHaveSolidTopSurface(par1World, par2, par3 - 1, par4)
|
||||
|| par1World.getBlock(par2, par3 - 1, par4).equals(Blocks.glowstone);
|
||||
|| par1World.getBlock(par2, par3 - 1, par4)
|
||||
.equals(Blocks.glowstone);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -134,7 +134,8 @@ public class BlockSnakestone extends Block {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!world.getBlock(x, y, z).equals(this)) continue;
|
||||
if (!world.getBlock(x, y, z)
|
||||
.equals(this)) continue;
|
||||
boolean match = false;
|
||||
|
||||
int px1 = x, px2 = x;
|
||||
@@ -250,17 +251,23 @@ public class BlockSnakestone extends Block {
|
||||
public boolean connectedTo(World par1World, int x, int y, int z, int direction) {
|
||||
switch (direction) {
|
||||
case 0:
|
||||
return par1World.getBlock(x, y, z - 1).equals(this);
|
||||
return par1World.getBlock(x, y, z - 1)
|
||||
.equals(this);
|
||||
case 1:
|
||||
return par1World.getBlock(x, y, z + 1).equals(this);
|
||||
return par1World.getBlock(x, y, z + 1)
|
||||
.equals(this);
|
||||
case 2:
|
||||
return par1World.getBlock(x - 1, y, z).equals(this);
|
||||
return par1World.getBlock(x - 1, y, z)
|
||||
.equals(this);
|
||||
case 3:
|
||||
return par1World.getBlock(x + 1, y, z).equals(this);
|
||||
return par1World.getBlock(x + 1, y, z)
|
||||
.equals(this);
|
||||
case 4:
|
||||
return par1World.getBlock(x, y - 1, z).equals(this);
|
||||
return par1World.getBlock(x, y - 1, z)
|
||||
.equals(this);
|
||||
case 5:
|
||||
return par1World.getBlock(x, y + 1, z).equals(this);
|
||||
return par1World.getBlock(x, y + 1, z)
|
||||
.equals(this);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -3,13 +3,13 @@ package team.chisel.block;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import team.chisel.carving.Carving;
|
||||
import team.chisel.item.ItemCarvable;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
import com.cricketcraft.chisel.api.carving.CarvingUtils;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import team.chisel.carving.Carving;
|
||||
import team.chisel.item.ItemCarvable;
|
||||
|
||||
public class CarvableStairsMaker {
|
||||
|
||||
@@ -29,20 +29,21 @@ public class CarvableStairsMaker {
|
||||
for (int i = 0; i < blocks.length; i++) {
|
||||
String n = name + "." + i;
|
||||
blocks[i] = creator == null ? new BlockCarvableStairs(blockBase, i * 2, carverHelper)
|
||||
: creator.create(blockBase, i * 2, carverHelper);
|
||||
: creator.create(blockBase, i * 2, carverHelper);
|
||||
|
||||
blocks[i].setBlockName("chisel." + n).setCreativeTab(ChiselTabs.tabStairChiselBlocks);
|
||||
blocks[i].setBlockName("chisel." + n)
|
||||
.setCreativeTab(ChiselTabs.tabStairChiselBlocks);
|
||||
GameRegistry.registerBlock(blocks[i], ItemCarvable.class, n);
|
||||
|
||||
for (int meta = 0; meta < 2 && i * 2 + meta < carverHelper.infoList.size(); meta++) {
|
||||
Carving.chisel.addVariation(name, CarvingUtils.getDefaultVariationFor(blocks[i], meta * 8, i));
|
||||
GameRegistry.addRecipe(
|
||||
new ItemStack(blocks[i], 4, meta * 8),
|
||||
"* ",
|
||||
"** ",
|
||||
"***",
|
||||
'*',
|
||||
new ItemStack(blockBase, 1, i * 2 + meta));
|
||||
new ItemStack(blocks[i], 4, meta * 8),
|
||||
"* ",
|
||||
"** ",
|
||||
"***",
|
||||
'*',
|
||||
new ItemStack(blockBase, 1, i * 2 + meta));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,10 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import com.cricketcraft.chisel.api.IChiselItem;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.Features;
|
||||
import team.chisel.carving.Carving;
|
||||
import team.chisel.client.GeneralChiselClient;
|
||||
@@ -24,11 +28,6 @@ import team.chisel.network.message.MessageAutoChisel;
|
||||
import team.chisel.network.message.MessageSlotUpdate;
|
||||
import team.chisel.utils.General;
|
||||
|
||||
import com.cricketcraft.chisel.api.IChiselItem;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class TileEntityAutoChisel extends TileEntity implements ISidedInventory {
|
||||
|
||||
public enum Upgrade {
|
||||
@@ -40,15 +39,19 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
||||
|
||||
public String getUnlocalizedName() {
|
||||
if (Features.AUTO_CHISEL_UPGRADES.enabled()) {
|
||||
return "item.upgrade_" + this.name().toLowerCase();
|
||||
return "item.upgrade_" + this.name()
|
||||
.toLowerCase();
|
||||
}
|
||||
return "chisel.autochisel.upgrade.disabled";
|
||||
}
|
||||
|
||||
public String getLocalizedName() {
|
||||
String ret = StatCollector.translateToLocal("autochisel.slot." + this.name().toLowerCase() + ".tooltip");
|
||||
String ret = StatCollector.translateToLocal(
|
||||
"autochisel.slot." + this.name()
|
||||
.toLowerCase() + ".tooltip");
|
||||
if (!Features.AUTO_CHISEL_UPGRADES.enabled()) {
|
||||
ret = EnumChatFormatting.RED.toString().concat(ret);
|
||||
ret = EnumChatFormatting.RED.toString()
|
||||
.concat(ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -227,12 +230,12 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
||||
}
|
||||
|
||||
return ((IChiselItem) inventory[CHISEL].getItem())
|
||||
.canChisel(worldObj, inventory[CHISEL], General.getVariation(getTarget()));
|
||||
.canChisel(worldObj, inventory[CHISEL], General.getVariation(getTarget()));
|
||||
}
|
||||
|
||||
private boolean hasChisel() {
|
||||
return inventory[CHISEL] != null && inventory[CHISEL].getItem() instanceof IChiselItem
|
||||
&& inventory[CHISEL].stackSize >= 1;
|
||||
&& inventory[CHISEL].stackSize >= 1;
|
||||
}
|
||||
|
||||
/** Calls IChiselItem#onChisel() and sends the chisel packet for sound/animation */
|
||||
@@ -240,7 +243,7 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
||||
if (!worldObj.isRemote) {
|
||||
boolean breakChisel = false;
|
||||
if (((IChiselItem) inventory[CHISEL].getItem())
|
||||
.onChisel(worldObj, inventory[CHISEL], General.getVariation(target))) {
|
||||
.onChisel(worldObj, inventory[CHISEL], General.getVariation(target))) {
|
||||
inventory[CHISEL].setItemDamage(inventory[CHISEL].getItemDamage() + 1);
|
||||
if (inventory[CHISEL].getItemDamage() >= inventory[CHISEL].getMaxDamage()) {
|
||||
setInventorySlotContents(CHISEL, null);
|
||||
@@ -248,18 +251,18 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
||||
}
|
||||
}
|
||||
PacketHandler.INSTANCE.sendToDimension(
|
||||
new MessageAutoChisel(this, chiseled, true, breakChisel),
|
||||
worldObj.provider.dimensionId);
|
||||
new MessageAutoChisel(this, chiseled, true, breakChisel),
|
||||
worldObj.provider.dimensionId);
|
||||
} else {
|
||||
if (breakChisel) {
|
||||
worldObj.playSound(
|
||||
xCoord + 0.5,
|
||||
yCoord + 0.5,
|
||||
zCoord + 0.5,
|
||||
"random.break",
|
||||
0.8F,
|
||||
0.8F + worldObj.rand.nextFloat() * 0.4F,
|
||||
false);
|
||||
xCoord + 0.5,
|
||||
yCoord + 0.5,
|
||||
zCoord + 0.5,
|
||||
"random.break",
|
||||
0.8F,
|
||||
0.8F + worldObj.rand.nextFloat() * 0.4F,
|
||||
false);
|
||||
}
|
||||
GeneralChiselClient.spawnAutoChiselFX(this, lastBase != null ? lastBase : inventory[BASE]);
|
||||
chiseling = false;
|
||||
@@ -331,7 +334,7 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
||||
|
||||
private void slotChanged(int slot) {
|
||||
PacketHandler.INSTANCE
|
||||
.sendToDimension(new MessageSlotUpdate(this, slot, inventory[slot]), worldObj.provider.dimensionId);
|
||||
.sendToDimension(new MessageSlotUpdate(this, slot, inventory[slot]), worldObj.provider.dimensionId);
|
||||
markDirty();
|
||||
}
|
||||
|
||||
@@ -369,14 +372,15 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
|
||||
switch (slot) {
|
||||
case BASE:
|
||||
case TARGET:
|
||||
return !Carving.chisel.getItemsForChiseling(itemStack).isEmpty();
|
||||
return !Carving.chisel.getItemsForChiseling(itemStack)
|
||||
.isEmpty();
|
||||
case OUTPUT:
|
||||
return false;
|
||||
case CHISEL:
|
||||
return itemStack.getItem() instanceof IChiselItem;
|
||||
default:
|
||||
return Features.AUTO_CHISEL_UPGRADES.enabled() && itemStack.getItem() == ChiselItems.upgrade
|
||||
&& Upgrade.values()[slot - MIN_UPGRADE].ordinal() == itemStack.getItemDamage();
|
||||
&& Upgrade.values()[slot - MIN_UPGRADE].ordinal() == itemStack.getItemDamage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,8 +47,8 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
||||
|
||||
private boolean connectTo(TileEntityPresent present, ForgeDirection dir) {
|
||||
if (present.getBlockMetadata() == getBlockMetadata() && !present.isConnected()
|
||||
&& (present.cachedDir == null || present.cachedDir == dir.getOpposite())
|
||||
&& Math.abs(present.xCoord - xCoord + present.yCoord - yCoord + present.zCoord - zCoord) == 1) {
|
||||
&& (present.cachedDir == null || present.cachedDir == dir.getOpposite())
|
||||
&& Math.abs(present.xCoord - xCoord + present.yCoord - yCoord + present.zCoord - zCoord) == 1) {
|
||||
connection = present;
|
||||
connection.connection = this;
|
||||
connection.cachedDir = dir.getOpposite();
|
||||
@@ -57,7 +57,7 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
||||
isParent = !present.isParent;
|
||||
markDirty();
|
||||
PacketHandler.INSTANCE
|
||||
.sendToDimension(new MessagePresentConnect(this, dir, true), worldObj.provider.dimensionId);
|
||||
.sendToDimension(new MessagePresentConnect(this, dir, true), worldObj.provider.dimensionId);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -87,8 +87,8 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
||||
this.connection = null;
|
||||
this.markDirty();
|
||||
PacketHandler.INSTANCE.sendToDimension(
|
||||
new MessagePresentConnect(this, ForgeDirection.UNKNOWN, false, preserveDir),
|
||||
worldObj.provider.dimensionId);
|
||||
new MessagePresentConnect(this, ForgeDirection.UNKNOWN, false, preserveDir),
|
||||
worldObj.provider.dimensionId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ public class TileEntityPresent extends TileEntity implements IInventory, IDouble
|
||||
|
||||
@Override
|
||||
public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y,
|
||||
int z) {
|
||||
int z) {
|
||||
// prevent losing TE data when in-world chiseling
|
||||
return oldBlock != newBlock;
|
||||
}
|
||||
|
||||
@@ -7,13 +7,13 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
|
||||
import com.cricketcraft.chisel.api.carving.CarvingUtils;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingGroup;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingRegistry;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
|
||||
public class Carving implements ICarvingRegistry {
|
||||
|
||||
GroupList groups = new GroupList();
|
||||
|
||||
@@ -30,7 +30,7 @@ public class GroupList implements Set<ICarvingGroup> {
|
||||
if (obj instanceof ICarvingVariation) {
|
||||
ICarvingVariation v2 = (ICarvingVariation) obj;
|
||||
return v.getBlock() == v2.getBlock()
|
||||
&& (v.getBlockMeta() == v2.getBlockMeta() || v.getItemMeta() == v2.getItemMeta());
|
||||
&& (v.getBlockMeta() == v2.getBlockMeta() || v.getItemMeta() == v2.getItemMeta());
|
||||
} else if (obj instanceof VariationWrapper) {
|
||||
return equals(((VariationWrapper) obj).v);
|
||||
}
|
||||
@@ -39,7 +39,8 @@ public class GroupList implements Set<ICarvingGroup> {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return v.getBlock().hashCode();
|
||||
return v.getBlock()
|
||||
.hashCode();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,17 +101,20 @@ public class GroupList implements Set<ICarvingGroup> {
|
||||
|
||||
@Override
|
||||
public Iterator<ICarvingGroup> iterator() {
|
||||
return groups.values().iterator();
|
||||
return groups.values()
|
||||
.iterator();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] toArray() {
|
||||
return groups.values().toArray();
|
||||
return groups.values()
|
||||
.toArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T[] toArray(T[] arr) {
|
||||
return groups.values().toArray(arr);
|
||||
return groups.values()
|
||||
.toArray(arr);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -134,7 +138,9 @@ public class GroupList implements Set<ICarvingGroup> {
|
||||
if (o instanceof ICarvingGroup) {
|
||||
List<VariationWrapper> toRemove = Lists.newArrayList();
|
||||
for (VariationWrapper v : lookup.keySet()) {
|
||||
if (lookup.get(v).getName().equals(((ICarvingGroup) o).getName())) {
|
||||
if (lookup.get(v)
|
||||
.getName()
|
||||
.equals(((ICarvingGroup) o).getName())) {
|
||||
toRemove.add(v);
|
||||
}
|
||||
}
|
||||
@@ -228,9 +234,11 @@ public class GroupList implements Set<ICarvingGroup> {
|
||||
}
|
||||
List<VariationWrapper> toRemove = Lists.newArrayList();
|
||||
for (VariationWrapper v : lookup.keySet()) {
|
||||
if ((g == null || lookup.get(v).getName().equals(g.getName()))
|
||||
&& v.equals(new VariationWrapper(new VariationKey(block, metadata)))) {
|
||||
lookup.get(v).removeVariation(v.v);
|
||||
if ((g == null || lookup.get(v)
|
||||
.getName()
|
||||
.equals(g.getName())) && v.equals(new VariationWrapper(new VariationKey(block, metadata)))) {
|
||||
lookup.get(v)
|
||||
.removeVariation(v.v);
|
||||
toRemove.add(v);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,19 +30,18 @@ public class GeneralChiselClient {
|
||||
|
||||
public static void spawnLavastoneFX(World world, BlockLavastone block, int x, int y, int z) {
|
||||
if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0
|
||||
|| Minecraft.getMinecraft().gameSettings.particleSetting != 0)
|
||||
return;
|
||||
|| Minecraft.getMinecraft().gameSettings.particleSetting != 0) return;
|
||||
|
||||
float f = 0.15F;
|
||||
double x1 = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - f * 2.0F)
|
||||
+ f
|
||||
+ block.getBlockBoundsMinX();
|
||||
+ f
|
||||
+ block.getBlockBoundsMinX();
|
||||
double y1 = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - f * 2.0F)
|
||||
+ f
|
||||
+ block.getBlockBoundsMinY();
|
||||
+ f
|
||||
+ block.getBlockBoundsMinY();
|
||||
double z1 = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - f * 2.0F)
|
||||
+ f
|
||||
+ block.getBlockBoundsMinZ();
|
||||
+ f
|
||||
+ block.getBlockBoundsMinZ();
|
||||
|
||||
switch (rand.nextInt(6)) {
|
||||
case 0:
|
||||
@@ -71,7 +70,8 @@ public class GeneralChiselClient {
|
||||
break;
|
||||
}
|
||||
|
||||
if (world.getBlock(x, y, z).isOpaqueCube()) return;
|
||||
if (world.getBlock(x, y, z)
|
||||
.isOpaqueCube()) return;
|
||||
|
||||
EntityLavaFX res = new EntityLavaFX(world, x1, y1, z1);
|
||||
double multiplier = 0.45;
|
||||
@@ -84,19 +84,18 @@ public class GeneralChiselClient {
|
||||
|
||||
public static void spawnHolystoneFX(World world, BlockHolystone block, int x, int y, int z) {
|
||||
if (Configurations.particlesTickrate != 0 && tick++ % Configurations.particlesTickrate != 0
|
||||
|| Minecraft.getMinecraft().gameSettings.particleSetting != 0)
|
||||
return;
|
||||
|| Minecraft.getMinecraft().gameSettings.particleSetting != 0) return;
|
||||
|
||||
float f = 0.15F;
|
||||
double x1 = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - f * 2.0F)
|
||||
+ f
|
||||
+ block.getBlockBoundsMinX();
|
||||
+ f
|
||||
+ block.getBlockBoundsMinX();
|
||||
double y1 = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - f * 2.0F)
|
||||
+ f
|
||||
+ block.getBlockBoundsMinY();
|
||||
+ f
|
||||
+ block.getBlockBoundsMinY();
|
||||
double z1 = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - f * 2.0F)
|
||||
+ f
|
||||
+ block.getBlockBoundsMinZ();
|
||||
+ f
|
||||
+ block.getBlockBoundsMinZ();
|
||||
|
||||
switch (rand.nextInt(6)) {
|
||||
case 0:
|
||||
@@ -125,7 +124,8 @@ public class GeneralChiselClient {
|
||||
break;
|
||||
}
|
||||
|
||||
if (world.getBlock(x, y, z).isOpaqueCube()) return;
|
||||
if (world.getBlock(x, y, z)
|
||||
.isOpaqueCube()) return;
|
||||
|
||||
EntityHolystoneFX res = new EntityHolystoneFX(world, block, x1, y1, z1);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(res);
|
||||
@@ -136,14 +136,14 @@ public class GeneralChiselClient {
|
||||
|
||||
float f = 0.15F;
|
||||
double x1 = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - f * 2.0F)
|
||||
+ f
|
||||
+ block.getBlockBoundsMinX();
|
||||
+ f
|
||||
+ block.getBlockBoundsMinX();
|
||||
double y1 = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - f * 2.0F)
|
||||
+ f
|
||||
+ block.getBlockBoundsMinY();
|
||||
+ f
|
||||
+ block.getBlockBoundsMinY();
|
||||
double z1 = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - f * 2.0F)
|
||||
+ f
|
||||
+ block.getBlockBoundsMinZ();
|
||||
+ f
|
||||
+ block.getBlockBoundsMinZ();
|
||||
|
||||
switch (rand.nextInt(6)) {
|
||||
case 0:
|
||||
@@ -172,7 +172,8 @@ public class GeneralChiselClient {
|
||||
break;
|
||||
}
|
||||
|
||||
if (world.getBlock(x, y, z).isOpaqueCube()) return;
|
||||
if (world.getBlock(x, y, z)
|
||||
.isOpaqueCube()) return;
|
||||
|
||||
EntityGrimstoneFX res = new EntityGrimstoneFX(world, block, x1, y1, z1);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(res);
|
||||
@@ -180,7 +181,7 @@ public class GeneralChiselClient {
|
||||
|
||||
public static void spawnSnakestoneObsidianFX(World world, BlockSnakestoneObsidian block, int x, int y, int z) {
|
||||
if (Configurations.particlesTickrate != 0 || tick++ % Configurations.particlesTickrate != 0
|
||||
|| Minecraft.getMinecraft().gameSettings.particleSetting != 0) {
|
||||
|| Minecraft.getMinecraft().gameSettings.particleSetting != 0) {
|
||||
EntitySnakestoneObsidianFX res = new EntitySnakestoneObsidianFX(world, block, x, y, z);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(res);
|
||||
}
|
||||
@@ -188,7 +189,7 @@ public class GeneralChiselClient {
|
||||
|
||||
public static void spawnBallOMossFX(World world, double x, double y, double z) {
|
||||
if (Configurations.particlesTickrate == 0 || tick++ % Configurations.particlesTickrate == 0
|
||||
|| Minecraft.getMinecraft().gameSettings.particleSetting != 0) {
|
||||
|| Minecraft.getMinecraft().gameSettings.particleSetting != 0) {
|
||||
EntityBallOMossFX res = new EntityBallOMossFX(world, x, y, z);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(res);
|
||||
}
|
||||
@@ -202,14 +203,14 @@ public class GeneralChiselClient {
|
||||
|
||||
float f = 0.1F;
|
||||
double d0 = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - f * 2.0F)
|
||||
+ f
|
||||
+ block.getBlockBoundsMinX();
|
||||
+ f
|
||||
+ block.getBlockBoundsMinX();
|
||||
double d1 = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - f * 2.0F)
|
||||
+ f
|
||||
+ block.getBlockBoundsMinY();
|
||||
+ f
|
||||
+ block.getBlockBoundsMinY();
|
||||
double d2 = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - f * 2.0F)
|
||||
+ f
|
||||
+ block.getBlockBoundsMinZ();
|
||||
+ f
|
||||
+ block.getBlockBoundsMinZ();
|
||||
|
||||
switch (side) {
|
||||
case 0:
|
||||
@@ -233,16 +234,16 @@ public class GeneralChiselClient {
|
||||
}
|
||||
|
||||
EntityDiggingFX res = new EntityDiggingFX(
|
||||
world,
|
||||
d0,
|
||||
d1,
|
||||
d2,
|
||||
0.0D,
|
||||
0.0D,
|
||||
0.0D,
|
||||
block,
|
||||
world.getBlockMetadata(x, y, z),
|
||||
side);
|
||||
world,
|
||||
d0,
|
||||
d1,
|
||||
d2,
|
||||
0.0D,
|
||||
0.0D,
|
||||
0.0D,
|
||||
block,
|
||||
world.getBlockMetadata(x, y, z),
|
||||
side);
|
||||
res.motionX = d0 - (x + 0.5);
|
||||
res.motionY = d1 - (y + 0.5);
|
||||
res.motionZ = d2 - (z + 0.5);
|
||||
@@ -271,19 +272,19 @@ public class GeneralChiselClient {
|
||||
if (base != null && Minecraft.getMinecraft().gameSettings.particleSetting == 0) {
|
||||
for (int i = 0; i < 10; i++) {
|
||||
EntityDiggingFX particle = new EntityDiggingFX(
|
||||
te.getWorldObj(),
|
||||
te.xCoord + 0.5,
|
||||
te.yCoord + 0.95,
|
||||
te.zCoord + 0.5,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
Block.getBlockFromItem(base.getItem()),
|
||||
base.getItemDamage());
|
||||
te.getWorldObj(),
|
||||
te.xCoord + 0.5,
|
||||
te.yCoord + 0.95,
|
||||
te.zCoord + 0.5,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
Block.getBlockFromItem(base.getItem()),
|
||||
base.getItemDamage());
|
||||
particle.setVelocity(
|
||||
(te.getWorldObj().rand.nextDouble() / 4) - 0.125,
|
||||
te.getWorldObj().rand.nextDouble() / 8,
|
||||
(te.getWorldObj().rand.nextDouble() / 4) - 0.125);
|
||||
(te.getWorldObj().rand.nextDouble() / 4) - 0.125,
|
||||
te.getWorldObj().rand.nextDouble() / 8,
|
||||
(te.getWorldObj().rand.nextDouble() / 4) - 0.125);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(particle);
|
||||
}
|
||||
String sound = Carving.chisel.getVariationSound(base.getItem(), base.getItemDamage());
|
||||
|
||||
@@ -10,12 +10,12 @@ import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import team.chisel.block.tileentity.TileEntityAutoChisel;
|
||||
import team.chisel.inventory.ContainerAutoChisel;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import team.chisel.block.tileentity.TileEntityAutoChisel;
|
||||
import team.chisel.inventory.ContainerAutoChisel;
|
||||
|
||||
public class GuiAutoChisel extends GuiContainer {
|
||||
|
||||
private static final ResourceLocation gui = new ResourceLocation("chisel:textures/autochisel-gui.png");
|
||||
@@ -55,8 +55,8 @@ public class GuiAutoChisel extends GuiContainer {
|
||||
|
||||
private boolean mouseInside(Slot slot, int x, int y) {
|
||||
return x >= slot.xDisplayPosition && x <= slot.xDisplayPosition + 16
|
||||
&& y >= slot.yDisplayPosition
|
||||
&& y <= slot.yDisplayPosition + 16;
|
||||
&& y >= slot.yDisplayPosition
|
||||
&& y <= slot.yDisplayPosition + 16;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -81,11 +81,11 @@ public class GuiAutoChisel extends GuiContainer {
|
||||
public static void drawSlotOverlay(GuiContainer gui, int x, int y, Slot slot, int u, int v, int padding) {
|
||||
padding /= 2;
|
||||
gui.drawTexturedModalRect(
|
||||
x + (slot.xDisplayPosition - padding),
|
||||
y + (slot.yDisplayPosition - padding),
|
||||
u,
|
||||
v,
|
||||
18 + padding,
|
||||
18 + padding);
|
||||
x + (slot.xDisplayPosition - padding),
|
||||
y + (slot.yDisplayPosition - padding),
|
||||
u,
|
||||
v,
|
||||
18 + padding,
|
||||
18 + padding);
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,12 @@ import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.cricketcraft.chisel.api.IAdvancedChisel;
|
||||
import com.cricketcraft.chisel.api.IChiselItem;
|
||||
import com.cricketcraft.chisel.api.carving.IChiselMode;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.client.gui.widgets.GuiButtonChiselMode;
|
||||
import team.chisel.inventory.ContainerChisel;
|
||||
import team.chisel.inventory.InventoryChiselSelection;
|
||||
@@ -23,19 +29,12 @@ import team.chisel.network.PacketHandler;
|
||||
import team.chisel.network.message.MessageChiselMode;
|
||||
import team.chisel.utils.General;
|
||||
|
||||
import com.cricketcraft.chisel.api.IAdvancedChisel;
|
||||
import com.cricketcraft.chisel.api.IChiselItem;
|
||||
import com.cricketcraft.chisel.api.carving.IChiselMode;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiChisel extends GuiContainer {
|
||||
|
||||
public static final ResourceLocation TEXTURE_RESOURCE_LOCATION = new ResourceLocation(
|
||||
MOD_ID,
|
||||
"textures/chisel2GuiScroll.png");
|
||||
MOD_ID,
|
||||
"textures/chisel2GuiScroll.png");
|
||||
public static final int TEXTURE_WIDTH = 266;
|
||||
public static final int TEXTURE_HEIGHT = 250;
|
||||
public static final int GUI_WIDTH = 266;
|
||||
@@ -91,7 +90,7 @@ public class GuiChisel extends GuiContainer {
|
||||
|
||||
private boolean showMode() {
|
||||
return container.chisel != null && container.chisel.getItem() instanceof IChiselItem
|
||||
&& ((IChiselItem) container.chisel.getItem()).hasModes(container.chisel);
|
||||
&& ((IChiselItem) container.chisel.getItem()).hasModes(container.chisel);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -100,15 +99,15 @@ public class GuiChisel extends GuiContainer {
|
||||
|
||||
final String titleText = I18n.format(container.inventory.getInventoryName() + ".title");
|
||||
fontRendererObj
|
||||
.drawSplitString(titleText, 50 - fontRendererObj.getStringWidth(titleText) / 2, 60, 40, 0x404040);
|
||||
.drawSplitString(titleText, 50 - fontRendererObj.getStringWidth(titleText) / 2, 60, 40, 0x404040);
|
||||
|
||||
if (showMode()) {
|
||||
final String modeText = I18n.format(container.inventory.getInventoryName() + ".mode");
|
||||
fontRendererObj.drawString(
|
||||
modeText,
|
||||
12 + (GuiButtonChiselMode.BUTTON_WIDTH - fontRendererObj.getStringWidth(modeText)) / 2,
|
||||
122,
|
||||
0x404040);
|
||||
modeText,
|
||||
12 + (GuiButtonChiselMode.BUTTON_WIDTH - fontRendererObj.getStringWidth(modeText)) / 2,
|
||||
122,
|
||||
0x404040);
|
||||
}
|
||||
|
||||
scrollBar.draw(this);
|
||||
@@ -119,21 +118,22 @@ public class GuiChisel extends GuiContainer {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
mc.getTextureManager().bindTexture(TEXTURE_RESOURCE_LOCATION);
|
||||
mc.getTextureManager()
|
||||
.bindTexture(TEXTURE_RESOURCE_LOCATION);
|
||||
// drawModalRectWithCustomSizedTexture: x, y, u, v, width, height, textureWidth, textureHeight
|
||||
func_146110_a(guiLeft, guiTop, 0, 0, xSize, ySize, TEXTURE_WIDTH, TEXTURE_HEIGHT);
|
||||
|
||||
Slot main = (Slot) container.inventorySlots.get(InventoryChiselSelection.normalSlots);
|
||||
if (main.getStack() == null) {
|
||||
func_146110_a(
|
||||
guiLeft + 8,
|
||||
guiTop + 8,
|
||||
0,
|
||||
GUI_HEIGHT,
|
||||
CHISEL_INPUT_SIZE,
|
||||
CHISEL_INPUT_SIZE,
|
||||
TEXTURE_WIDTH,
|
||||
TEXTURE_HEIGHT);
|
||||
guiLeft + 8,
|
||||
guiTop + 8,
|
||||
0,
|
||||
GUI_HEIGHT,
|
||||
CHISEL_INPUT_SIZE,
|
||||
CHISEL_INPUT_SIZE,
|
||||
TEXTURE_WIDTH,
|
||||
TEXTURE_HEIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,20 +5,20 @@ import net.minecraftforge.common.config.ConfigCategory;
|
||||
import net.minecraftforge.common.config.ConfigElement;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
import cpw.mods.fml.client.config.GuiConfig;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.config.Configurations;
|
||||
import cpw.mods.fml.client.config.GuiConfig;
|
||||
|
||||
public class GuiChiselConfig extends GuiConfig {
|
||||
|
||||
public GuiChiselConfig(GuiScreen parent) {
|
||||
super(
|
||||
parent,
|
||||
new ConfigElement<ConfigCategory>(Configurations.config.getCategory(Configuration.CATEGORY_GENERAL))
|
||||
.getChildElements(),
|
||||
Chisel.MOD_ID,
|
||||
false,
|
||||
false,
|
||||
GuiConfig.getAbridgedConfigPath(Configurations.config.toString()));
|
||||
parent,
|
||||
new ConfigElement<ConfigCategory>(Configurations.config.getCategory(Configuration.CATEGORY_GENERAL))
|
||||
.getChildElements(),
|
||||
Chisel.MOD_ID,
|
||||
false,
|
||||
false,
|
||||
GuiConfig.getAbridgedConfigPath(Configurations.config.toString()));
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,8 @@ public class GuiPresent extends GuiContainer {
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(gui);
|
||||
this.mc.getTextureManager()
|
||||
.bindTexture(gui);
|
||||
int x = (this.width - this.xSize) / 2;
|
||||
int y = (this.height - this.ySize) / 2;
|
||||
this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.rows * 18 + 17);
|
||||
|
||||
@@ -11,8 +11,8 @@ import team.chisel.network.message.MessageScrollUpdate;
|
||||
public class GuiScrollbar {
|
||||
|
||||
public static final ResourceLocation TEXTURE_RESOURCE_LOCATION = new ResourceLocation(
|
||||
"minecraft",
|
||||
"textures/gui/container/creative_inventory/tabs.png");
|
||||
"minecraft",
|
||||
"textures/gui/container/creative_inventory/tabs.png");
|
||||
|
||||
private int displayX = 0;
|
||||
private int displayY = 0;
|
||||
@@ -28,7 +28,8 @@ public class GuiScrollbar {
|
||||
public void draw(GuiChisel g) {
|
||||
// chisel2GuiScroll scroll button texture coordinates work strange (maybe because of alignment) so taking
|
||||
// vanilla one
|
||||
g.mc.getTextureManager().bindTexture(TEXTURE_RESOURCE_LOCATION);
|
||||
g.mc.getTextureManager()
|
||||
.bindTexture(TEXTURE_RESOURCE_LOCATION);
|
||||
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
|
||||
if (getMaxScroll() == 0) {
|
||||
|
||||
@@ -7,10 +7,10 @@ import net.minecraft.client.gui.GuiButton;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import team.chisel.client.gui.GuiChisel;
|
||||
import team.chisel.item.chisel.ChiselMode;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.client.gui.GuiChisel;
|
||||
import team.chisel.item.chisel.ChiselMode;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiButtonChiselMode extends GuiButton {
|
||||
@@ -42,12 +42,13 @@ public class GuiButtonChiselMode extends GuiButton {
|
||||
@Override
|
||||
public void drawButton(final Minecraft mc, final int mouseX, final int mouseY) {
|
||||
if (this.visible) {
|
||||
mc.getTextureManager().bindTexture(TEXTURE_RESOURCE_LOCATION);
|
||||
mc.getTextureManager()
|
||||
.bindTexture(TEXTURE_RESOURCE_LOCATION);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
// Mouse Hover State
|
||||
this.field_146123_n = mouseX >= this.xPosition && mouseY >= this.yPosition
|
||||
&& mouseX < this.xPosition + this.width
|
||||
&& mouseY < this.yPosition + this.height;
|
||||
&& mouseX < this.xPosition + this.width
|
||||
&& mouseY < this.yPosition + this.height;
|
||||
drawButtonBackgroundLayer();
|
||||
drawButtonForegroundLayer();
|
||||
}
|
||||
@@ -57,14 +58,14 @@ public class GuiButtonChiselMode extends GuiButton {
|
||||
final float u = BUTTON_BACKGROUND_U + (this.field_146123_n ? BUTTON_WIDTH : 0);
|
||||
// drawModalRectWithCustomSizedTexture: x, y, u, v, width, height, textureWidth, textureHeight
|
||||
func_146110_a(
|
||||
this.xPosition,
|
||||
this.yPosition,
|
||||
u,
|
||||
BUTTON_BACKGROUND_V,
|
||||
this.width,
|
||||
this.height,
|
||||
TEXTURE_WIDTH,
|
||||
TEXTURE_HEIGHT);
|
||||
this.xPosition,
|
||||
this.yPosition,
|
||||
u,
|
||||
BUTTON_BACKGROUND_V,
|
||||
this.width,
|
||||
this.height,
|
||||
TEXTURE_WIDTH,
|
||||
TEXTURE_HEIGHT);
|
||||
}
|
||||
|
||||
private void drawButtonForegroundLayer() {
|
||||
|
||||
@@ -12,27 +12,27 @@ public class RenderBlocksEldritch extends RenderBlocks {
|
||||
}
|
||||
|
||||
static double displacementMap[] = { +0.1165, -0.0352, -0.1208, +0.0906, -0.0295, +0.0302, -0.0973, +0.0548, -0.1077,
|
||||
+0.0662, -0.0932, -0.0925, -0.1161, +0.0073, -0.1084, +0.1136, +0.0307, +0.0316, -0.1066, -0.0237, +0.0614,
|
||||
-0.0864, +0.0837, +0.1218, +0.0502, -0.0529, -0.0942, +0.1209, -0.0418, +0.1035, +0.0066, -0.0255, +0.0830,
|
||||
-0.0361, +0.0965, +0.0646, +0.1124, +0.0890, -0.0037, +0.0467, +0.1025, +0.1161, +0.0014, +0.0365, +0.0755,
|
||||
-0.0025, +0.0739, +0.0656, +0.0571, -0.0813, -0.0062, -0.0904, -0.0005, +0.0612, -0.0227, +0.0138, -0.0899,
|
||||
-0.0019, -0.1047, +0.1191, -0.1197, -0.1123, +0.0999, +0.0638, +0.0865, +0.0029, -0.0084, +0.1132, -0.0433,
|
||||
+0.0115, +0.0850, +0.0439, +0.0748, +0.0460, -0.0441, +0.0839, +0.0162, -0.0229, +0.0774, -0.0647, -0.0636,
|
||||
-0.0709, -0.0719, -0.0194, +0.1070, -0.0466, -0.1200, -0.0996, -0.0298, -0.1035, -0.0006, +0.0530, -0.0939,
|
||||
-0.1210, +0.0176, +0.0924, +0.0343, -0.0777, +0.1050, -0.0729, -0.0062, -0.1107, -0.0434, -0.0042, +0.0232,
|
||||
+0.0269, +0.0709, -0.0388, +0.0342, +0.0240, -0.0192, +0.0491, +0.0017, -0.1240, +0.0687, -0.1160, +0.1123,
|
||||
-0.0332, -0.0260, +0.0476, -0.0049, -0.0893, -0.0243, -0.0371, -0.0230, +0.0656, +0.1080, +0.0781, -0.0648,
|
||||
+0.0082, -0.1086, -0.0451, -0.0594, -0.1155, -0.0623, -0.0152, +0.0131, -0.0754, +0.0607, +0.0876, -0.0657,
|
||||
+0.0366, -0.0981, +0.1164, -0.0623, +0.0181, -0.0475, +0.0722, -0.0293, +0.0486, -0.0195, +0.1041, +0.1011,
|
||||
+0.0042, -0.0045, -0.1031, +0.0110, +0.0058, +0.0083, -0.0782, -0.1003, -0.0082, -0.0304, -0.0971, -0.0097,
|
||||
-0.0208, -0.1059, -0.0239, -0.0385, +0.0505, +0.0537, -0.1098, -0.0022, -0.0165, -0.0027, -0.0208, +0.0305,
|
||||
+0.0592, +0.0301, +0.0055, +0.1138, -0.0338, -0.0901, +0.1015, +0.0061, +0.0861, -0.1057, -0.0889, -0.0972,
|
||||
+0.0783, -0.1052, -0.0932, -0.1103, +0.0497, +0.1222, -0.0146, +0.0632, -0.0240, -0.0193, +0.0676, -0.1128,
|
||||
-0.0886, +0.0926, +0.0538, -0.0175, -0.0966, -0.0369, +0.1124, -0.0820, -0.1013, -0.0836, -0.0981, -0.0502,
|
||||
+0.0573, +0.0616, -0.0458, +0.0294, +0.0108, -0.0782, +0.0692, +0.0234, -0.0178, -0.0171, -0.0505, -0.0313,
|
||||
+0.0538, +0.0462, -0.0758, +0.0556, -0.0023, -0.1086, -0.0100, -0.0897, -0.0409, -0.1161, +0.0212, +0.1229,
|
||||
-0.0945, +0.0341, +0.1238, +0.0893, -0.1189, -0.1098, -0.0125, +0.1137, -0.0202, +0.0239, -0.0408, +0.0920,
|
||||
+0.0777, -0.0085, -0.0572, -0.0293, -0.0131, +0.0272, +0.0991, };
|
||||
+0.0662, -0.0932, -0.0925, -0.1161, +0.0073, -0.1084, +0.1136, +0.0307, +0.0316, -0.1066, -0.0237, +0.0614,
|
||||
-0.0864, +0.0837, +0.1218, +0.0502, -0.0529, -0.0942, +0.1209, -0.0418, +0.1035, +0.0066, -0.0255, +0.0830,
|
||||
-0.0361, +0.0965, +0.0646, +0.1124, +0.0890, -0.0037, +0.0467, +0.1025, +0.1161, +0.0014, +0.0365, +0.0755,
|
||||
-0.0025, +0.0739, +0.0656, +0.0571, -0.0813, -0.0062, -0.0904, -0.0005, +0.0612, -0.0227, +0.0138, -0.0899,
|
||||
-0.0019, -0.1047, +0.1191, -0.1197, -0.1123, +0.0999, +0.0638, +0.0865, +0.0029, -0.0084, +0.1132, -0.0433,
|
||||
+0.0115, +0.0850, +0.0439, +0.0748, +0.0460, -0.0441, +0.0839, +0.0162, -0.0229, +0.0774, -0.0647, -0.0636,
|
||||
-0.0709, -0.0719, -0.0194, +0.1070, -0.0466, -0.1200, -0.0996, -0.0298, -0.1035, -0.0006, +0.0530, -0.0939,
|
||||
-0.1210, +0.0176, +0.0924, +0.0343, -0.0777, +0.1050, -0.0729, -0.0062, -0.1107, -0.0434, -0.0042, +0.0232,
|
||||
+0.0269, +0.0709, -0.0388, +0.0342, +0.0240, -0.0192, +0.0491, +0.0017, -0.1240, +0.0687, -0.1160, +0.1123,
|
||||
-0.0332, -0.0260, +0.0476, -0.0049, -0.0893, -0.0243, -0.0371, -0.0230, +0.0656, +0.1080, +0.0781, -0.0648,
|
||||
+0.0082, -0.1086, -0.0451, -0.0594, -0.1155, -0.0623, -0.0152, +0.0131, -0.0754, +0.0607, +0.0876, -0.0657,
|
||||
+0.0366, -0.0981, +0.1164, -0.0623, +0.0181, -0.0475, +0.0722, -0.0293, +0.0486, -0.0195, +0.1041, +0.1011,
|
||||
+0.0042, -0.0045, -0.1031, +0.0110, +0.0058, +0.0083, -0.0782, -0.1003, -0.0082, -0.0304, -0.0971, -0.0097,
|
||||
-0.0208, -0.1059, -0.0239, -0.0385, +0.0505, +0.0537, -0.1098, -0.0022, -0.0165, -0.0027, -0.0208, +0.0305,
|
||||
+0.0592, +0.0301, +0.0055, +0.1138, -0.0338, -0.0901, +0.1015, +0.0061, +0.0861, -0.1057, -0.0889, -0.0972,
|
||||
+0.0783, -0.1052, -0.0932, -0.1103, +0.0497, +0.1222, -0.0146, +0.0632, -0.0240, -0.0193, +0.0676, -0.1128,
|
||||
-0.0886, +0.0926, +0.0538, -0.0175, -0.0966, -0.0369, +0.1124, -0.0820, -0.1013, -0.0836, -0.0981, -0.0502,
|
||||
+0.0573, +0.0616, -0.0458, +0.0294, +0.0108, -0.0782, +0.0692, +0.0234, -0.0178, -0.0171, -0.0505, -0.0313,
|
||||
+0.0538, +0.0462, -0.0758, +0.0556, -0.0023, -0.1086, -0.0100, -0.0897, -0.0409, -0.1161, +0.0212, +0.1229,
|
||||
-0.0945, +0.0341, +0.1238, +0.0893, -0.1189, -0.1098, -0.0125, +0.1137, -0.0202, +0.0239, -0.0408, +0.0920,
|
||||
+0.0777, -0.0085, -0.0572, -0.0293, -0.0131, +0.0272, +0.0991, };
|
||||
|
||||
static int dmap1 = displacementMap.length * 1 / 6;
|
||||
static int dmap2 = displacementMap.length * 2 / 6;
|
||||
|
||||
@@ -54,9 +54,11 @@ public class RenderChiselSnowman extends RenderLiving {
|
||||
|
||||
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(itemStack, EQUIPPED);
|
||||
boolean is3D = (customRenderer != null
|
||||
&& customRenderer.shouldUseRenderHelper(EQUIPPED, itemStack, BLOCK_3D));
|
||||
&& customRenderer.shouldUseRenderHelper(EQUIPPED, itemStack, BLOCK_3D));
|
||||
|
||||
if (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(itemStack.getItem()).getRenderType())) {
|
||||
if (is3D || RenderBlocks.renderItemIn3d(
|
||||
Block.getBlockFromItem(itemStack.getItem())
|
||||
.getRenderType())) {
|
||||
float f1 = 0.625F;
|
||||
GL11.glTranslatef(0.0F, -0.34375F, 0.0F);
|
||||
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package team.chisel.client.render;
|
||||
|
||||
import team.chisel.ctmlib.CTMRenderer;
|
||||
|
||||
import com.cricketcraft.chisel.api.rendering.ClientUtils;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import team.chisel.ctmlib.CTMRenderer;
|
||||
|
||||
public class RendererCTM extends CTMRenderer {
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import team.chisel.ctmlib.Drawing;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import team.chisel.ctmlib.Drawing;
|
||||
|
||||
public class RendererCTMPane implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@@ -200,7 +200,7 @@ public class RendererCTMPane implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
RenderBlocks renderer) {
|
||||
BlockPane block = (BlockPane) b;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
@@ -230,12 +230,12 @@ public class RendererCTMPane implements ISimpleBlockRenderingHandler {
|
||||
|
||||
if (renderer.hasOverrideBlockTexture()) {
|
||||
paneRenderer.set(
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
renderer.overrideBlockTexture,
|
||||
renderer.overrideBlockTexture,
|
||||
renderer.overrideBlockTexture);
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
renderer.overrideBlockTexture,
|
||||
renderer.overrideBlockTexture,
|
||||
renderer.overrideBlockTexture);
|
||||
} else {
|
||||
paneRenderer.set(x, y, z, iconPane, iconTop, iconSide);
|
||||
}
|
||||
@@ -259,8 +259,8 @@ public class RendererCTMPane implements ISimpleBlockRenderingHandler {
|
||||
|
||||
boolean isolatedTop = !connectsTopNorth && !connectsTopSouth && !connectsTopWest && !connectsTopEast;
|
||||
boolean isolatedBottom = !connectsBottomNorth && !connectsBottomSouth
|
||||
&& !connectsBottomWest
|
||||
&& !connectsBottomEast;
|
||||
&& !connectsBottomWest
|
||||
&& !connectsBottomEast;
|
||||
|
||||
if (!connectsNorth && !connectsSouth && !connectsWest && !connectsEast) {
|
||||
connectsNorth = connectsSouth = connectsWest = connectsEast = true;
|
||||
|
||||
@@ -6,10 +6,10 @@ import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.ctmlib.Drawing;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.ctmlib.Drawing;
|
||||
|
||||
public class RendererEldritch implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@@ -28,7 +28,7 @@ public class RendererEldritch implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks rendererOld) {
|
||||
RenderBlocks rendererOld) {
|
||||
|
||||
// tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x,
|
||||
// y, z));
|
||||
|
||||
@@ -7,13 +7,13 @@ import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.block.BlockCarvableGlow;
|
||||
import team.chisel.config.Configurations;
|
||||
import team.chisel.ctmlib.Drawing;
|
||||
import team.chisel.utils.GeneralClient;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
public class RendererLayeredGlow implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@@ -35,7 +35,7 @@ public class RendererLayeredGlow implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
RenderBlocks renderer) {
|
||||
Tessellator.instance.setColorOpaque_I(Configurations.configColors[world.getBlockMetadata(x, y, z)]);
|
||||
Tessellator.instance.setBrightness(0xF000F0);
|
||||
Drawing.renderAllFaces(renderer, block, x, y, z, ((BlockCarvableGlow) block).getGlowTexture());
|
||||
|
||||
@@ -8,10 +8,10 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
import team.chisel.block.BlockMultiLayerBase;
|
||||
import team.chisel.ctmlib.Drawing;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import team.chisel.block.BlockMultiLayerBase;
|
||||
import team.chisel.ctmlib.Drawing;
|
||||
|
||||
public class RendererMultiLayer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@@ -48,7 +48,7 @@ public class RendererMultiLayer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
RenderBlocks renderer) {
|
||||
if (blck == null || !(blck instanceof BlockMultiLayerBase)) return false;
|
||||
BlockMultiLayerBase block = (BlockMultiLayerBase) blck;
|
||||
|
||||
|
||||
@@ -7,11 +7,11 @@ import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.block.BlockRoadLine;
|
||||
import team.chisel.ctmlib.Drawing;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
public class RendererRoadLine implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@@ -36,7 +36,7 @@ public class RendererRoadLine implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
RenderBlocks renderer) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
BlockRoadLine block = (BlockRoadLine) b;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
@@ -59,10 +59,14 @@ public class RendererRoadLine implements ISimpleBlockRenderingHandler {
|
||||
}
|
||||
tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);
|
||||
|
||||
boolean N = world.getBlock(x, y, z - 1).equals(block) && world.getBlockMetadata(x, y, z - 1) == meta;
|
||||
boolean S = world.getBlock(x, y, z + 1).equals(block) && world.getBlockMetadata(x, y, z + 1) == meta;
|
||||
boolean W = world.getBlock(x - 1, y, z).equals(block) && world.getBlockMetadata(x - 1, y, z) == meta;
|
||||
boolean E = world.getBlock(x + 1, y, z).equals(block) && world.getBlockMetadata(x + 1, y, z) == meta;
|
||||
boolean N = world.getBlock(x, y, z - 1)
|
||||
.equals(block) && world.getBlockMetadata(x, y, z - 1) == meta;
|
||||
boolean S = world.getBlock(x, y, z + 1)
|
||||
.equals(block) && world.getBlockMetadata(x, y, z + 1) == meta;
|
||||
boolean W = world.getBlock(x - 1, y, z)
|
||||
.equals(block) && world.getBlockMetadata(x - 1, y, z) == meta;
|
||||
boolean E = world.getBlock(x + 1, y, z)
|
||||
.equals(block) && world.getBlockMetadata(x + 1, y, z) == meta;
|
||||
|
||||
if (!N && !S && !W && !E) {
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
|
||||
@@ -6,11 +6,11 @@ import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.block.BlockCarvableLayered;
|
||||
import team.chisel.ctmlib.Drawing;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
public class RendererSimpleLayered implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class RendererSimpleLayered implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
RenderBlocks renderer) {
|
||||
renderer.setOverrideBlockTexture(((BlockCarvableLayered) block).getBaseTex());
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.clearOverrideBlockTexture();
|
||||
|
||||
@@ -6,10 +6,10 @@ import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import team.chisel.block.BlockSnakestone;
|
||||
import team.chisel.ctmlib.Drawing;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import team.chisel.block.BlockSnakestone;
|
||||
import team.chisel.ctmlib.Drawing;
|
||||
|
||||
public class RendererSnakeStone implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class RendererSnakeStone implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
RenderBlocks renderer) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
setRenderRotate(renderer, (BlockSnakestone) block, meta);
|
||||
|
||||
@@ -6,10 +6,10 @@ import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import team.chisel.block.BlockCarvableStairs;
|
||||
import team.chisel.ctmlib.Drawing;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import team.chisel.block.BlockCarvableStairs;
|
||||
import team.chisel.ctmlib.Drawing;
|
||||
|
||||
public class RendererStairs implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class RendererStairs implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
RenderBlocks renderer) {
|
||||
if (blck == null || !(blck instanceof BlockCarvableStairs)) return false;
|
||||
BlockCarvableStairs block = (BlockCarvableStairs) blck;
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@ import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.ctmlib.Drawing;
|
||||
import team.chisel.ctmlib.RenderBlocksCTM;
|
||||
import team.chisel.ctmlib.TextureSubmap;
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SubmapManagerAntiblock extends SubmapManagerBase {
|
||||
|
||||
@@ -36,9 +36,9 @@ public class SubmapManagerAntiblock extends SubmapManagerBase {
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
Drawing.drawBlock(
|
||||
ChiselBlocks.antiBlock,
|
||||
ChiselBlocks.antiBlock.getIcon(0, item.getItemDamage()),
|
||||
(RenderBlocks) data[0]);
|
||||
ChiselBlocks.antiBlock,
|
||||
ChiselBlocks.antiBlock.getIcon(0, item.getItemDamage()),
|
||||
(RenderBlocks) data[0]);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import team.chisel.ctmlib.ISubmapManager;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.ctmlib.ISubmapManager;
|
||||
|
||||
public abstract class SubmapManagerBase implements ISubmapManager {
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import team.chisel.ctmlib.RenderBlocksCTM;
|
||||
import team.chisel.ctmlib.TextureSubmap;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.ctmlib.RenderBlocksCTM;
|
||||
import team.chisel.ctmlib.TextureSubmap;
|
||||
|
||||
public class SubmapManagerCarpetFloor extends SubmapManagerBase {
|
||||
|
||||
|
||||
@@ -10,15 +10,14 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Triple;
|
||||
|
||||
import team.chisel.ctmlib.RenderBlocksCTM;
|
||||
import team.chisel.ctmlib.TextureSubmap;
|
||||
|
||||
import com.cricketcraft.chisel.api.carving.CarvingUtils;
|
||||
import com.cricketcraft.chisel.api.rendering.TextureType;
|
||||
import com.cricketcraft.chisel.api.rendering.TextureType.AbstractSubmapManager;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.ctmlib.RenderBlocksCTM;
|
||||
import team.chisel.ctmlib.TextureSubmap;
|
||||
|
||||
public class SubmapManagerCombinedCTM extends SubmapManagerBase {
|
||||
|
||||
@@ -67,14 +66,14 @@ public class SubmapManagerCombinedCTM extends SubmapManagerBase {
|
||||
int iz = MathHelper.floor_double(z);
|
||||
if (type == TextureType.V4 || type == TextureType.V9) {
|
||||
submap = (TextureSubmap) TextureType
|
||||
.getVIcon(rType, SubmapManagerCombinedCTM.this.submap, ix, iy, iz, side.ordinal());
|
||||
.getVIcon(rType, SubmapManagerCombinedCTM.this.submap, ix, iy, iz, side.ordinal());
|
||||
submapSmall = (TextureSubmap) TextureType
|
||||
.getVIcon(rType, SubmapManagerCombinedCTM.this.smallSubmap, ix, iy, iz, side.ordinal());
|
||||
.getVIcon(rType, SubmapManagerCombinedCTM.this.smallSubmap, ix, iy, iz, side.ordinal());
|
||||
} else {
|
||||
submap = (TextureSubmap) TextureType
|
||||
.getRIcon(rType, SubmapManagerCombinedCTM.this.submap, ix, iy, iz, side.ordinal());
|
||||
.getRIcon(rType, SubmapManagerCombinedCTM.this.submap, ix, iy, iz, side.ordinal());
|
||||
submapSmall = (TextureSubmap) TextureType
|
||||
.getRIcon(rType, SubmapManagerCombinedCTM.this.smallSubmap, ix, iy, iz, side.ordinal());
|
||||
.getRIcon(rType, SubmapManagerCombinedCTM.this.smallSubmap, ix, iy, iz, side.ordinal());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,13 +110,18 @@ public class SubmapManagerCombinedCTM extends SubmapManagerBase {
|
||||
|
||||
public SubmapManagerCombinedCTM(int meta, String texturePath, TextureType rType) {
|
||||
assert rType == TextureType.R16 || rType == TextureType.R9
|
||||
|| rType == TextureType.R4
|
||||
|| rType == TextureType.V4
|
||||
|| rType == TextureType.V9 : "Not a valid random type!";
|
||||
|| rType == TextureType.R4
|
||||
|| rType == TextureType.V4
|
||||
|| rType == TextureType.V9 : "Not a valid random type!";
|
||||
|
||||
this.meta = meta;
|
||||
this.texturePath = texturePath;
|
||||
this.size = Integer.parseInt(rType.name().substring(1, rType.name().length())); // >.>
|
||||
this.size = Integer.parseInt(
|
||||
rType.name()
|
||||
.substring(
|
||||
1,
|
||||
rType.name()
|
||||
.length())); // >.>
|
||||
this.rType = rType;
|
||||
}
|
||||
|
||||
@@ -146,14 +150,15 @@ public class SubmapManagerCombinedCTM extends SubmapManagerBase {
|
||||
TextureSubmap[][] submapsSmall = new TextureSubmap[wh][wh];
|
||||
for (int i = 0; i < size; i++) {
|
||||
AbstractSubmapManager manager = (AbstractSubmapManager) TextureType.CTMX
|
||||
.createManagerFor(CarvingUtils.getDefaultVariationFor(block, meta, 0), texturePath + "-" + i);
|
||||
.createManagerFor(CarvingUtils.getDefaultVariationFor(block, meta, 0), texturePath + "-" + i);
|
||||
manager.registerIcons(modName, block, register);
|
||||
Object cached = manager.getCachedObject();
|
||||
Triple<IIcon, TextureSubmap, TextureSubmap> triple = (Triple<IIcon, TextureSubmap, TextureSubmap>) cached;
|
||||
submaps[i % wh][i / wh] = triple.getMiddle();
|
||||
submapsSmall[i % wh][i / wh] = triple.getRight();
|
||||
if (i == 0) {
|
||||
defaultIcon = triple.getRight().getBaseIcon();
|
||||
defaultIcon = triple.getRight()
|
||||
.getBaseIcon();
|
||||
}
|
||||
}
|
||||
submap = new Submap(base, wh, submaps);
|
||||
|
||||
@@ -7,15 +7,14 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.ctmlib.CTM;
|
||||
import team.chisel.ctmlib.TextureSubmap;
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.ctmlib.CTM;
|
||||
import team.chisel.ctmlib.TextureSubmap;
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
|
||||
public class SubmapManagerFakeController extends SubmapManagerBase {
|
||||
|
||||
@@ -63,8 +62,8 @@ public class SubmapManagerFakeController extends SubmapManagerBase {
|
||||
map = new TextureSubmap(register.registerIcon(modName + ":" + texturePath), 2, 2);
|
||||
} else {
|
||||
Chisel.logger.info(
|
||||
"SubmapManagerFakeController was called on block " + block.getUnlocalizedName()
|
||||
+ " without declaring texture, using a default texture instead.");
|
||||
"SubmapManagerFakeController was called on block " + block.getUnlocalizedName()
|
||||
+ " without declaring texture, using a default texture instead.");
|
||||
map = new TextureSubmap(register.registerIcon(modName + ":futura/WIP/controller"), 2, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,11 +7,11 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.ctmlib.ISubmapManager;
|
||||
import team.chisel.ctmlib.RenderBlocksCTM;
|
||||
import team.chisel.ctmlib.TextureSubmap;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SubmapManagerSlab implements ISubmapManager {
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import team.chisel.ctmlib.RenderBlocksCTM;
|
||||
import team.chisel.ctmlib.TextureSubmap;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.ctmlib.RenderBlocksCTM;
|
||||
import team.chisel.ctmlib.TextureSubmap;
|
||||
|
||||
public class SubmapManagerSpecialMaterial extends SubmapManagerBase {
|
||||
|
||||
@@ -67,7 +67,8 @@ public class SubmapManagerSpecialMaterial extends SubmapManagerBase {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(String modName, Block block, IIconRegister register) {
|
||||
String materialName = materialType.name().toLowerCase();
|
||||
String materialName = materialType.name()
|
||||
.toLowerCase();
|
||||
submap = new TextureSubmap(register.registerIcon(modName + ":" + materialName + "/" + color + "-ctm"), 4, 4);
|
||||
submapSmall = new TextureSubmap(register.registerIcon(modName + ":" + materialName + "/" + color), 2, 2);
|
||||
}
|
||||
|
||||
@@ -8,15 +8,14 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import team.chisel.ctmlib.ISubmapManager;
|
||||
import team.chisel.ctmlib.RenderBlocksCTM;
|
||||
import team.chisel.ctmlib.TextureSubmap;
|
||||
|
||||
import com.cricketcraft.chisel.api.carving.CarvingUtils;
|
||||
import com.cricketcraft.chisel.api.rendering.TextureType;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.ctmlib.ISubmapManager;
|
||||
import team.chisel.ctmlib.RenderBlocksCTM;
|
||||
import team.chisel.ctmlib.TextureSubmap;
|
||||
|
||||
public class SubmapManagerVoidstone extends SubmapManagerBase {
|
||||
|
||||
@@ -87,12 +86,12 @@ public class SubmapManagerVoidstone extends SubmapManagerBase {
|
||||
|
||||
private IIcon getBase(double x, double y, double z, int side) {
|
||||
return TextureType.getVIcon(
|
||||
TextureType.V4,
|
||||
base,
|
||||
MathHelper.floor_double(x),
|
||||
MathHelper.floor_double(y),
|
||||
MathHelper.floor_double(z),
|
||||
side);
|
||||
TextureType.V4,
|
||||
base,
|
||||
MathHelper.floor_double(x),
|
||||
MathHelper.floor_double(y),
|
||||
MathHelper.floor_double(z),
|
||||
side);
|
||||
}
|
||||
|
||||
private String texture;
|
||||
@@ -116,7 +115,7 @@ public class SubmapManagerVoidstone extends SubmapManagerBase {
|
||||
@Override
|
||||
public void registerIcons(String modName, Block block, IIconRegister register) {
|
||||
overlay = TextureType.getTypeFor(null, modName, texture)
|
||||
.createManagerFor(CarvingUtils.getDefaultVariationFor(block, meta, 0), texture);
|
||||
.createManagerFor(CarvingUtils.getDefaultVariationFor(block, meta, 0), texture);
|
||||
overlay.registerIcons(modName, block, register);
|
||||
base = new TextureSubmap(register.registerIcon(modName + ":" + "animations/hadesX32"), 2, 2);
|
||||
}
|
||||
|
||||
@@ -30,27 +30,27 @@ public class ItemChiselRenderer implements IItemRenderer {
|
||||
// Fixes potential render bug with blocks that draw this item
|
||||
renderItem.zLevel = 10f;
|
||||
renderItem.renderItemIntoGUI(
|
||||
Minecraft.getMinecraft().fontRenderer,
|
||||
Minecraft.getMinecraft().renderEngine,
|
||||
stack,
|
||||
0,
|
||||
0);
|
||||
Minecraft.getMinecraft().fontRenderer,
|
||||
Minecraft.getMinecraft().renderEngine,
|
||||
stack,
|
||||
0,
|
||||
0);
|
||||
|
||||
if (stack.stackTagCompound != null) {
|
||||
|
||||
ItemStack chiselTarget = ItemStack
|
||||
.loadItemStackFromNBT(stack.stackTagCompound.getCompoundTag("chiselTarget"));
|
||||
.loadItemStackFromNBT(stack.stackTagCompound.getCompoundTag("chiselTarget"));
|
||||
if (chiselTarget != null) {
|
||||
|
||||
GL11.glScalef(0.65f, 0.65f, 0.65f);
|
||||
GL11.glTranslatef(-8f, -8f, 0.0f);
|
||||
|
||||
renderItem.renderItemIntoGUI(
|
||||
Minecraft.getMinecraft().fontRenderer,
|
||||
Minecraft.getMinecraft().renderEngine,
|
||||
chiselTarget,
|
||||
8,
|
||||
8);
|
||||
Minecraft.getMinecraft().fontRenderer,
|
||||
Minecraft.getMinecraft().renderEngine,
|
||||
chiselTarget,
|
||||
8,
|
||||
8);
|
||||
}
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -25,18 +25,18 @@ import net.minecraftforge.client.model.obj.TextureCoordinate;
|
||||
import net.minecraftforge.client.model.obj.Vertex;
|
||||
import net.minecraftforge.client.model.obj.WavefrontObject;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.block.tileentity.TileEntityAutoChisel;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.block.tileentity.TileEntityAutoChisel;
|
||||
|
||||
public class RenderAutoChisel extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler, IItemRenderer {
|
||||
|
||||
private static final WavefrontObject model = new WavefrontObject(
|
||||
new ResourceLocation(Chisel.MOD_ID, "models/autoChisel/autoChisel.obj"));
|
||||
new ResourceLocation(Chisel.MOD_ID, "models/autoChisel/autoChisel.obj"));
|
||||
private static final ResourceLocation texture = new ResourceLocation(
|
||||
Chisel.MOD_ID,
|
||||
"textures/blocks/autoChisel/autoChisel.png");
|
||||
Chisel.MOD_ID,
|
||||
"textures/blocks/autoChisel/autoChisel.png");
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
@@ -46,7 +46,7 @@ public class RenderAutoChisel extends TileEntitySpecialRenderer implements ISimp
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return helper == ItemRendererHelper.INVENTORY_BLOCK || helper == ItemRendererHelper.ENTITY_BOBBING
|
||||
|| helper == ItemRendererHelper.ENTITY_ROTATION;
|
||||
|| helper == ItemRendererHelper.ENTITY_ROTATION;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -85,7 +85,7 @@ public class RenderAutoChisel extends TileEntitySpecialRenderer implements ISimp
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
RenderBlocks renderer) {
|
||||
Tessellator tes = Tessellator.instance;
|
||||
IIcon icon = renderer.hasOverrideBlockTexture() ? renderer.overrideBlockTexture : block.getIcon(0, 0);
|
||||
tes.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||
@@ -100,18 +100,18 @@ public class RenderAutoChisel extends TileEntitySpecialRenderer implements ISimp
|
||||
TextureCoordinate t = f.textureCoordinates[i];
|
||||
if (!renderer.hasOverrideBlockTexture()) {
|
||||
tes.addVertexWithUV(
|
||||
vert.x,
|
||||
vert.y,
|
||||
vert.z,
|
||||
icon.getInterpolatedU(t.u * 16),
|
||||
icon.getInterpolatedV(t.v * 16));
|
||||
vert.x,
|
||||
vert.y,
|
||||
vert.z,
|
||||
icon.getInterpolatedU(t.u * 16),
|
||||
icon.getInterpolatedV(t.v * 16));
|
||||
} else {
|
||||
tes.addVertexWithUV(
|
||||
vert.x,
|
||||
vert.y,
|
||||
vert.z,
|
||||
icon.getInterpolatedU((t.u * 64) % 16),
|
||||
icon.getInterpolatedV((t.v * 64) % 16));
|
||||
vert.x,
|
||||
vert.y,
|
||||
vert.z,
|
||||
icon.getInterpolatedU((t.u * 64) % 16),
|
||||
icon.getInterpolatedV((t.v * 64) % 16));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -159,7 +159,8 @@ public class RenderAutoChisel extends TileEntitySpecialRenderer implements ISimp
|
||||
|
||||
float max = 0.35f;
|
||||
|
||||
if (!Minecraft.getMinecraft().isGamePaused()) {
|
||||
if (!Minecraft.getMinecraft()
|
||||
.isGamePaused()) {
|
||||
autoChisel.xRot += (rand.nextFloat() * max) - (max / 2);
|
||||
autoChisel.yRot += (rand.nextFloat() * max) - (max / 2);
|
||||
autoChisel.zRot += (rand.nextFloat() * max) - (max / 2);
|
||||
@@ -195,8 +196,8 @@ public class RenderAutoChisel extends TileEntitySpecialRenderer implements ISimp
|
||||
glPushMatrix();
|
||||
glTranslated(x + 0.7, y + 1.01, z + 0.5);
|
||||
float rot = autoChisel.chiselRot == 0 ? 0
|
||||
: autoChisel.chiseling ? autoChisel.chiselRot + (TileEntityAutoChisel.rotAmnt * scale)
|
||||
: autoChisel.chiselRot - (TileEntityAutoChisel.rotAmnt * scale);
|
||||
: autoChisel.chiseling ? autoChisel.chiselRot + (TileEntityAutoChisel.rotAmnt * scale)
|
||||
: autoChisel.chiselRot - (TileEntityAutoChisel.rotAmnt * scale);
|
||||
glRotatef(rot, 0, 0, 1);
|
||||
glTranslated(-0.12, 0, 0);
|
||||
glScalef(0.9f, 0.9f, 0.9f);
|
||||
|
||||
@@ -18,9 +18,9 @@ import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import team.chisel.block.tileentity.TileEntityCarvableBeacon;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import team.chisel.block.tileentity.TileEntityCarvableBeacon;
|
||||
|
||||
public class RenderCarvableBeacon extends TileEntityBeaconRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@@ -151,7 +151,7 @@ public class RenderCarvableBeacon extends TileEntityBeaconRenderer implements IS
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
RenderBlocks renderer) {
|
||||
float f = 0.1875F;
|
||||
boolean breaking = renderer.hasOverrideBlockTexture();
|
||||
if (!breaking) {
|
||||
|
||||
@@ -14,13 +14,13 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.block.tileentity.TileEntityPresent;
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
||||
public class RenderPresent extends TileEntitySpecialRenderer implements IItemRenderer {
|
||||
|
||||
private ModelChest smallChest = new ModelChest();
|
||||
@@ -77,8 +77,8 @@ public class RenderPresent extends TileEntitySpecialRenderer implements IItemRen
|
||||
}
|
||||
|
||||
private void bindTexture(TileEntityPresent present) {
|
||||
int idx = present.getWorldObj().getBlockMetadata(present.xCoord, present.yCoord, present.zCoord)
|
||||
+ (present.isConnected() ? 0 : 16);
|
||||
int idx = present.getWorldObj()
|
||||
.getBlockMetadata(present.xCoord, present.yCoord, present.zCoord) + (present.isConnected() ? 0 : 16);
|
||||
ResourceLocation rl = textureCache.get(idx);
|
||||
if (rl == null) {
|
||||
String res = ChiselBlocks.present.getModelTexture(idx % 16);
|
||||
@@ -106,10 +106,11 @@ public class RenderPresent extends TileEntitySpecialRenderer implements IItemRen
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(
|
||||
FMLClientHandler.instance()
|
||||
.getClient().renderEngine.bindTexture(
|
||||
new ResourceLocation(
|
||||
Chisel.MOD_ID,
|
||||
ChiselBlocks.present.getModelTexture(item.getItemDamage()) + ".png"));
|
||||
Chisel.MOD_ID,
|
||||
ChiselBlocks.present.getModelTexture(item.getItemDamage()) + ".png"));
|
||||
switch (type) {
|
||||
case ENTITY:
|
||||
renderBlock(0.0F, 1.0F, 0.0F);
|
||||
|
||||
@@ -8,20 +8,19 @@ import java.util.Map;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import team.chisel.carving.Carving;
|
||||
import team.chisel.client.gui.GuiChisel;
|
||||
import team.chisel.utils.RecipeUtil;
|
||||
import codechicken.nei.api.GuiInfo;
|
||||
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingGroup;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.pahimar.ee3.api.exchange.RecipeRegistryProxy;
|
||||
|
||||
import codechicken.nei.api.GuiInfo;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import team.chisel.carving.Carving;
|
||||
import team.chisel.client.gui.GuiChisel;
|
||||
import team.chisel.utils.RecipeUtil;
|
||||
|
||||
public class Compatibility {
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@ package team.chisel.compat;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.carving.Carving;
|
||||
|
||||
import com.cricketcraft.chisel.api.IMC;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingRegistry;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.carving.Carving;
|
||||
|
||||
public class IMCHandler {
|
||||
|
||||
@@ -48,11 +48,11 @@ public class IMCHandler {
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Chisel.logger.error(
|
||||
"Could not handle data {} for IMC type {}. This was sent from mod {}.\n"
|
||||
+ "!! This is a bug in that mod !!\nSwallowing error and continuing...",
|
||||
value,
|
||||
type.name(),
|
||||
message.getSender());
|
||||
"Could not handle data {} for IMC type {}. This was sent from mod {}.\n"
|
||||
+ "!! This is a bug in that mod !!\nSwallowing error and continuing...",
|
||||
value,
|
||||
type.name(),
|
||||
message.getSender());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,6 @@ package team.chisel.compat;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.IWailaRegistrar;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -16,6 +11,11 @@ import net.minecraft.world.World;
|
||||
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||
import mcp.mobius.waila.api.IWailaRegistrar;
|
||||
|
||||
public class WailaCompat implements IWailaDataProvider {
|
||||
|
||||
private WailaCompat() {}
|
||||
@@ -27,31 +27,31 @@ public class WailaCompat implements IWailaDataProvider {
|
||||
|
||||
@Override
|
||||
public List<String> getWailaHead(ItemStack stack, List<String> strings, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler configHandler) {
|
||||
IWailaConfigHandler configHandler) {
|
||||
return strings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack stack, List<String> strings, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler configHandler) {
|
||||
IWailaConfigHandler configHandler) {
|
||||
if (accessor.getBlock() instanceof ICarvable) {
|
||||
ICarvable block = (ICarvable) accessor.getBlock();
|
||||
MovingObjectPosition pos = accessor.getPosition();
|
||||
strings.add(
|
||||
block.getManager(accessor.getWorld(), pos.blockX, pos.blockY, pos.blockZ, accessor.getMetadata())
|
||||
.getDescription());
|
||||
block.getManager(accessor.getWorld(), pos.blockX, pos.blockY, pos.blockZ, accessor.getMetadata())
|
||||
.getDescription());
|
||||
}
|
||||
return strings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getWailaTail(ItemStack stack, List<String> strings, IWailaDataAccessor accessor,
|
||||
IWailaConfigHandler configHandler) {
|
||||
IWailaConfigHandler configHandler) {
|
||||
return strings;
|
||||
}
|
||||
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World world, int x,
|
||||
int y, int z) {
|
||||
int y, int z) {
|
||||
return tag;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,14 +3,14 @@ package team.chisel.compat.fmp;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import codechicken.lib.vec.BlockCoord;
|
||||
import codechicken.multipart.MultiPartRegistry;
|
||||
import codechicken.multipart.MultiPartRegistry.IPartConverter;
|
||||
import codechicken.multipart.MultiPartRegistry.IPartFactory;
|
||||
import codechicken.multipart.TMultiPart;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
|
||||
public class FMPCompat implements IPartFactory, IPartConverter {
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@ import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import team.chisel.block.BlockCarvableTorch;
|
||||
import codechicken.lib.vec.BlockCoord;
|
||||
import codechicken.multipart.TMultiPart;
|
||||
import codechicken.multipart.TileMultipart;
|
||||
import codechicken.multipart.minecraft.TorchPart;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.block.BlockCarvableTorch;
|
||||
|
||||
public class ItemBlockChiselTorchPart extends ItemBlock {
|
||||
|
||||
@@ -28,7 +28,7 @@ public class ItemBlockChiselTorchPart extends ItemBlock {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean func_150936_a(World world, int x, int y, int z, int side, EntityPlayer player, ItemStack stack) {
|
||||
return (placePart(world, new BlockCoord(x, y, z).offset(side), stack, side, false))
|
||||
|| (super.func_150936_a(world, x, y, z, side, player, stack));
|
||||
|| (super.func_150936_a(world, x, y, z, side, player, stack));
|
||||
}
|
||||
|
||||
public TMultiPart createMultiPart(World world, BlockCoord pos, ItemStack item, int side) {
|
||||
@@ -55,7 +55,7 @@ public class ItemBlockChiselTorchPart extends ItemBlock {
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float hitX, float hitY, float hitZ) {
|
||||
float hitX, float hitY, float hitZ) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
BlockCoord pos = new BlockCoord(x, y, z);
|
||||
if (!block.isReplaceable(world, x, y, z)) {
|
||||
@@ -63,12 +63,12 @@ public class ItemBlockChiselTorchPart extends ItemBlock {
|
||||
}
|
||||
if (placePart(world, pos, stack, side, !world.isRemote)) {
|
||||
world.playSoundEffect(
|
||||
pos.x + 0.5F,
|
||||
pos.y + 0.5F,
|
||||
pos.z + 0.5F,
|
||||
field_150939_a.stepSound.func_150496_b(),
|
||||
(block.stepSound.getVolume() + 1.0F) / 2.0F,
|
||||
block.stepSound.getPitch() * 0.8F);
|
||||
pos.x + 0.5F,
|
||||
pos.y + 0.5F,
|
||||
pos.z + 0.5F,
|
||||
field_150939_a.stepSound.func_150496_b(),
|
||||
(block.stepSound.getVolume() + 1.0F) / 2.0F,
|
||||
block.stepSound.getPitch() * 0.8F);
|
||||
stack.stackSize -= 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ package team.chisel.compat.fmp;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
import codechicken.lib.data.MCDataInput;
|
||||
import codechicken.lib.data.MCDataOutput;
|
||||
import codechicken.multipart.minecraft.TorchPart;
|
||||
import team.chisel.init.ChiselBlocks;
|
||||
|
||||
public class PartChiselTorch extends TorchPart {
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ package team.chisel.compat.nei;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.client.gui.GuiChisel;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IConfigureNEI;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.client.gui.GuiChisel;
|
||||
|
||||
public class NEIChiselConfig implements IConfigureNEI {
|
||||
|
||||
|
||||
@@ -11,16 +11,16 @@ import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import team.chisel.carving.Carving;
|
||||
import team.chisel.client.gui.GuiChisel;
|
||||
import com.cricketcraft.chisel.api.carving.CarvingUtils;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingGroup;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
|
||||
import com.cricketcraft.chisel.api.carving.CarvingUtils;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingGroup;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
||||
import team.chisel.carving.Carving;
|
||||
import team.chisel.client.gui.GuiChisel;
|
||||
|
||||
public class RecipeHandlerChisel extends TemplateRecipeHandler {
|
||||
|
||||
@@ -109,10 +109,10 @@ public class RecipeHandlerChisel extends TemplateRecipeHandler {
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
this.transferRects.add(
|
||||
new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(75, 22, 15, 13),
|
||||
"chisel2.chisel",
|
||||
new Object[0]));
|
||||
new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(75, 22, 15, 13),
|
||||
"chisel2.chisel",
|
||||
new Object[0]));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -120,7 +120,8 @@ public class RecipeHandlerChisel extends TemplateRecipeHandler {
|
||||
if (outputId.equals("chisel2.chisel")) {
|
||||
for (String name : Carving.chisel.getSortedGroupNames()) {
|
||||
ICarvingGroup g = Carving.chisel.getGroup(name);
|
||||
if (!g.getVariations().isEmpty()) {
|
||||
if (!g.getVariations()
|
||||
.isEmpty()) {
|
||||
addCached(getVariationStacks(g));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,217 +73,241 @@ public class Configurations {
|
||||
/* general */
|
||||
category = "general";
|
||||
concreteVelocityMult = config
|
||||
.get(
|
||||
category,
|
||||
"concreteVelocityMult",
|
||||
1.35,
|
||||
"The factor that concrete increases your velocity. Default is 1.35, set to 1 for no change.")
|
||||
.getDouble();
|
||||
fullBlockConcrete = config.get(
|
||||
.get(
|
||||
category,
|
||||
"concreteVelocityMult",
|
||||
1.35,
|
||||
"The factor that concrete increases your velocity. Default is 1.35, set to 1 for no change.")
|
||||
.getDouble();
|
||||
fullBlockConcrete = config
|
||||
.get(
|
||||
category,
|
||||
"fullBlockConcrete",
|
||||
false,
|
||||
"Should concrete be a full block. This will also unavoidably disable speed increase if set to true.")
|
||||
.getBoolean(false);
|
||||
ghostCloud = config.get(category, "doesCloudRenderLikeGhost", true).getBoolean(true);
|
||||
factoryBlockAmount = config.get(category, "amountYouGetFromFactoryBlockCrafting", 32).getInt(32);
|
||||
allowMossy = config.get(
|
||||
.getBoolean(false);
|
||||
ghostCloud = config.get(category, "doesCloudRenderLikeGhost", true)
|
||||
.getBoolean(true);
|
||||
factoryBlockAmount = config.get(category, "amountYouGetFromFactoryBlockCrafting", 32)
|
||||
.getInt(32);
|
||||
allowMossy = config
|
||||
.get(
|
||||
category,
|
||||
"allowBrickToMossyInChisel",
|
||||
true,
|
||||
"If true, you can chisel stone brick to mossy stone brick.").getBoolean(true);
|
||||
allowSmoothStone = config.get(category, "allowSmoothStoneToStoneBricksAndBack", true).getBoolean(true);
|
||||
"If true, you can chisel stone brick to mossy stone brick.")
|
||||
.getBoolean(true);
|
||||
allowSmoothStone = config.get(category, "allowSmoothStoneToStoneBricksAndBack", true)
|
||||
.getBoolean(true);
|
||||
chiselRecipe = config
|
||||
.get(category, "chiselAlternateRecipe", false, "Use alternative crafting recipe for the chisel")
|
||||
.getBoolean(false);
|
||||
enableFMP = config.get(category, "enableFMP", true, "Do you want to enable FMP").getBoolean(true);
|
||||
chiselStoneToCobbleBricks = config.get(
|
||||
.get(category, "chiselAlternateRecipe", false, "Use alternative crafting recipe for the chisel")
|
||||
.getBoolean(false);
|
||||
enableFMP = config.get(category, "enableFMP", true, "Do you want to enable FMP")
|
||||
.getBoolean(true);
|
||||
chiselStoneToCobbleBricks = config
|
||||
.get(
|
||||
category,
|
||||
"chiselStoneToCobbleBricks",
|
||||
true,
|
||||
"Chisel stone to cobblestone and bricks by left clicking.").getBoolean(false);
|
||||
"Chisel stone to cobblestone and bricks by left clicking.")
|
||||
.getBoolean(false);
|
||||
chiselBackToVanillaLeaves = config.get(
|
||||
category,
|
||||
"chiselBackToVanillaLeaves",
|
||||
false,
|
||||
"If this is true, you can chisel from the chisel leaves back to vanilla ones. If it is false, you cannot.")
|
||||
.getBoolean(false);
|
||||
category,
|
||||
"chiselBackToVanillaLeaves",
|
||||
false,
|
||||
"If this is true, you can chisel from the chisel leaves back to vanilla ones. If it is false, you cannot.")
|
||||
.getBoolean(false);
|
||||
canMobsSpawnOnTheChiselBlocks = config
|
||||
.get(category, "canMobsSpawnOnTheChiselBlocks", false, "Can mobs Spawn on the Chisel Blocks")
|
||||
.getBoolean();
|
||||
.get(category, "canMobsSpawnOnTheChiselBlocks", false, "Can mobs Spawn on the Chisel Blocks")
|
||||
.getBoolean();
|
||||
|
||||
/* worldgen */
|
||||
category = "worldgen";
|
||||
marbleAmount = config
|
||||
.get(category, "marbleAmount", 7, "Amount of marble to generate in the world; use 0 for none")
|
||||
.getInt(7);
|
||||
.get(category, "marbleAmount", 7, "Amount of marble to generate in the world; use 0 for none")
|
||||
.getInt(7);
|
||||
limestoneAmount = config
|
||||
.get(category, "limestoneAmount", 8, "Amount of limestone to generate in the world; use 0 for none")
|
||||
.getInt(8);
|
||||
.get(category, "limestoneAmount", 8, "Amount of limestone to generate in the world; use 0 for none")
|
||||
.getInt(8);
|
||||
graniteAmount = config
|
||||
.get(category, "graniteAmount", 8, "Amount of granite to generate in the world; use 0 for none.")
|
||||
.getInt(8);
|
||||
.get(category, "graniteAmount", 8, "Amount of granite to generate in the world; use 0 for none.")
|
||||
.getInt(8);
|
||||
dioriteAmount = config
|
||||
.get(category, "dioriteAmount", 8, "Amount of diorite to generate in the world; use 0 for none.")
|
||||
.getInt(8);
|
||||
.get(category, "dioriteAmount", 8, "Amount of diorite to generate in the world; use 0 for none.")
|
||||
.getInt(8);
|
||||
andesiteAmount = config
|
||||
.get(category, "andesiteAmount", 8, "Amount of andesite to generate in the world; use 0 for none.")
|
||||
.getInt(8);
|
||||
.get(category, "andesiteAmount", 8, "Amount of andesite to generate in the world; use 0 for none.")
|
||||
.getInt(8);
|
||||
|
||||
/* client */
|
||||
category = "client";
|
||||
particlesTickrate = config
|
||||
.get(category, "particleTickrate", 1, "Particle tick rate. Greater value = less particles.").getInt(1);
|
||||
oldPillars = config.get(category, "pillarOldGraphics", false, "Use old pillar textures").getBoolean(false);
|
||||
disableCTM = !config.get(category, "connectedTextures", true, "Enable connected textures").getBoolean(true);
|
||||
.get(category, "particleTickrate", 1, "Particle tick rate. Greater value = less particles.")
|
||||
.getInt(1);
|
||||
oldPillars = config.get(category, "pillarOldGraphics", false, "Use old pillar textures")
|
||||
.getBoolean(false);
|
||||
disableCTM = !config.get(category, "connectedTextures", true, "Enable connected textures")
|
||||
.getBoolean(true);
|
||||
CTM.disableObscuredFaceCheckConfig = connectInsideCTM = config
|
||||
.get(
|
||||
category,
|
||||
"connectInsideCTM",
|
||||
false,
|
||||
"Choose whether the inside corner is disconnected on a CTM block - http://imgur.com/eUywLZ4")
|
||||
.getBoolean(false);
|
||||
blockDescriptions = config.get(
|
||||
.get(
|
||||
category,
|
||||
"connectInsideCTM",
|
||||
false,
|
||||
"Choose whether the inside corner is disconnected on a CTM block - http://imgur.com/eUywLZ4")
|
||||
.getBoolean(false);
|
||||
blockDescriptions = config
|
||||
.get(
|
||||
category,
|
||||
"tooltipsUseBlockDescriptions",
|
||||
true,
|
||||
"Make variations of blocks have the same name, and use the description in tooltip to distinguish them.")
|
||||
.getBoolean(true);
|
||||
imTooGoodForDescriptions = config.get(
|
||||
.getBoolean(true);
|
||||
imTooGoodForDescriptions = config
|
||||
.get(
|
||||
category,
|
||||
"imTooGoodForBlockDescriptions",
|
||||
false,
|
||||
"For those people who just hate block descriptions on the world gen!").getBoolean();
|
||||
"For those people who just hate block descriptions on the world gen!")
|
||||
.getBoolean();
|
||||
|
||||
/* chisel */
|
||||
category = "chisel";
|
||||
allowChiselDamage = config.get(
|
||||
allowChiselDamage = config
|
||||
.get(
|
||||
category,
|
||||
"allowChiselDamage",
|
||||
true,
|
||||
"Should the chisel be damageable and take damage when it chisels something.").getBoolean();
|
||||
"Should the chisel be damageable and take damage when it chisels something.")
|
||||
.getBoolean();
|
||||
ironChiselMaxDamage = config.getInt(
|
||||
"ironChiselMaxDamage",
|
||||
category,
|
||||
500,
|
||||
1,
|
||||
Short.MAX_VALUE,
|
||||
"The max damage of the standard iron chisel.");
|
||||
"ironChiselMaxDamage",
|
||||
category,
|
||||
500,
|
||||
1,
|
||||
Short.MAX_VALUE,
|
||||
"The max damage of the standard iron chisel.");
|
||||
diamondChiselMaxDamage = config.getInt(
|
||||
"diamondChiselMaxDamage",
|
||||
category,
|
||||
5000,
|
||||
1,
|
||||
Short.MAX_VALUE,
|
||||
"The max damage of the diamond chisel.");
|
||||
"diamondChiselMaxDamage",
|
||||
category,
|
||||
5000,
|
||||
1,
|
||||
Short.MAX_VALUE,
|
||||
"The max damage of the diamond chisel.");
|
||||
obsidianChiselMaxDamage = config.getInt(
|
||||
"obsidianChiselMaxDamage",
|
||||
category,
|
||||
2500,
|
||||
1,
|
||||
Short.MAX_VALUE,
|
||||
"The max damage of the obsidian chisel.");
|
||||
"obsidianChiselMaxDamage",
|
||||
category,
|
||||
2500,
|
||||
1,
|
||||
Short.MAX_VALUE,
|
||||
"The max damage of the obsidian chisel.");
|
||||
netherStarChiselMaxDamage = config.getInt(
|
||||
"netherStarChiselMaxDamage",
|
||||
category,
|
||||
32767,
|
||||
1,
|
||||
Short.MAX_VALUE,
|
||||
"The max damage of the nether star chisel.");
|
||||
"netherStarChiselMaxDamage",
|
||||
category,
|
||||
32767,
|
||||
1,
|
||||
Short.MAX_VALUE,
|
||||
"The max damage of the nether star chisel.");
|
||||
ironChiselCanLeftClick = config
|
||||
.get(
|
||||
category,
|
||||
"ironChiselCanLeftClick",
|
||||
true,
|
||||
"If this is true, the iron chisel can left click chisel blocks. If false, it cannot.")
|
||||
.getBoolean();
|
||||
.get(
|
||||
category,
|
||||
"ironChiselCanLeftClick",
|
||||
true,
|
||||
"If this is true, the iron chisel can left click chisel blocks. If false, it cannot.")
|
||||
.getBoolean();
|
||||
ironChiselHasModes = config
|
||||
.get(
|
||||
category,
|
||||
"ironChiselHasModes",
|
||||
false,
|
||||
"If this is true, the iron chisel can change its chisel mode just as the diamond chisel can.")
|
||||
.getBoolean();
|
||||
allowChiselCrossColors = config.get(
|
||||
.get(
|
||||
category,
|
||||
"ironChiselHasModes",
|
||||
false,
|
||||
"If this is true, the iron chisel can change its chisel mode just as the diamond chisel can.")
|
||||
.getBoolean();
|
||||
allowChiselCrossColors = config
|
||||
.get(
|
||||
category,
|
||||
"allowChiselCrossColors",
|
||||
true,
|
||||
"Should someone be able to chisel something into a different color.").getBoolean();
|
||||
"Should someone be able to chisel something into a different color.")
|
||||
.getBoolean();
|
||||
|
||||
ironChiselAttackDamage = config.get(
|
||||
category,
|
||||
"ironChiselAttackDamage",
|
||||
2,
|
||||
"The extra attack damage points (in half hearts) that the iron chisel inflicts when it is used to attack an entity.")
|
||||
.getInt();
|
||||
category,
|
||||
"ironChiselAttackDamage",
|
||||
2,
|
||||
"The extra attack damage points (in half hearts) that the iron chisel inflicts when it is used to attack an entity.")
|
||||
.getInt();
|
||||
diamondChiselAttackDamage = config.get(
|
||||
category,
|
||||
"diamondChiselAttackDamage",
|
||||
2,
|
||||
"The extra attack damage points (in half hearts) that the diamond chisel inflicts when it is used to attack an entity.")
|
||||
.getInt();
|
||||
category,
|
||||
"diamondChiselAttackDamage",
|
||||
2,
|
||||
"The extra attack damage points (in half hearts) that the diamond chisel inflicts when it is used to attack an entity.")
|
||||
.getInt();
|
||||
obsidianChiselAttackDamage = config.get(
|
||||
category,
|
||||
"obsidianChiselAttackDamage",
|
||||
4,
|
||||
"The extra attack damage points (in half hearts) that the obsidian chisel inflicts when it is used to attack an entity.")
|
||||
.getInt();
|
||||
category,
|
||||
"obsidianChiselAttackDamage",
|
||||
4,
|
||||
"The extra attack damage points (in half hearts) that the obsidian chisel inflicts when it is used to attack an entity.")
|
||||
.getInt();
|
||||
netherStarChiselAttackDamage = config.get(
|
||||
category,
|
||||
"netherStarChiselAttackDamage",
|
||||
6,
|
||||
"The extra attack damage points (in half hearts) that the nether star chisel inflicts when it is used to attack an entity.")
|
||||
.getInt();
|
||||
category,
|
||||
"netherStarChiselAttackDamage",
|
||||
6,
|
||||
"The extra attack damage points (in half hearts) that the nether star chisel inflicts when it is used to attack an entity.")
|
||||
.getInt();
|
||||
|
||||
/* block */
|
||||
category = "block";
|
||||
useRoadLineTool = config.get(
|
||||
useRoadLineTool = config
|
||||
.get(
|
||||
category,
|
||||
"useRoadLineTool",
|
||||
false,
|
||||
"Should the road line require a tool to break (If false, road lines can be broken in Adventure)")
|
||||
.getBoolean();
|
||||
.getBoolean();
|
||||
getRoadLineTool = config
|
||||
.get(
|
||||
category,
|
||||
"getRoadLineTool",
|
||||
"pickaxe",
|
||||
"The tool that is able to break roadLines (requires useRoadLineTool to be true to take effect)")
|
||||
.getString();
|
||||
roadLineToolLevel = config.get(
|
||||
.get(
|
||||
category,
|
||||
"roadLineToolLevel",
|
||||
0,
|
||||
"The lowest harvest level of the tool able to break the road lines (requires useRoadLineTool to be true to take effect) (0 = Wood/Gold, 1 = Stone, 2 = Iron, 3 = Diamond) Default: 0")
|
||||
.getInt();
|
||||
"getRoadLineTool",
|
||||
"pickaxe",
|
||||
"The tool that is able to break roadLines (requires useRoadLineTool to be true to take effect)")
|
||||
.getString();
|
||||
roadLineToolLevel = config.get(
|
||||
category,
|
||||
"roadLineToolLevel",
|
||||
0,
|
||||
"The lowest harvest level of the tool able to break the road lines (requires useRoadLineTool to be true to take effect) (0 = Wood/Gold, 1 = Stone, 2 = Iron, 3 = Diamond) Default: 0")
|
||||
.getInt();
|
||||
|
||||
/* hexColors */
|
||||
category = "hexColors";
|
||||
|
||||
for (int i = 0; i < ItemDye.field_150923_a.length; i++) {
|
||||
// tterrag... don't kill me over this formatting.
|
||||
String temp = config.get(
|
||||
String temp = config
|
||||
.get(
|
||||
category,
|
||||
"hex" + ItemDye.field_150923_a[i],
|
||||
"#" + Integer.toHexString(ItemDye.field_150922_c[i]),
|
||||
Character.toUpperCase(ItemDye.field_150923_a[i].charAt(0)) + ItemDye.field_150923_a[i].substring(1)
|
||||
+ " color for hex block overlay #RRGGBB")
|
||||
.getString();
|
||||
+ " color for hex block overlay #RRGGBB")
|
||||
.getString();
|
||||
// Or this
|
||||
try {
|
||||
configColors[i] = Integer.decode(temp);
|
||||
} catch (NumberFormatException e) {
|
||||
Chisel.logger.warn(
|
||||
"Configuration error, " + temp
|
||||
+ " was not recognized as a color. Using default: #"
|
||||
+ Integer.toHexString(ItemDye.field_150922_c[i]));
|
||||
"Configuration error, " + temp
|
||||
+ " was not recognized as a color. Using default: #"
|
||||
+ Integer.toHexString(ItemDye.field_150922_c[i]));
|
||||
configColors[i] = ItemDye.field_150922_c[i];
|
||||
}
|
||||
}
|
||||
|
||||
/* features */
|
||||
for (Features feature : Features.values()) {
|
||||
features.put(featureName(feature), config.get("features", featureName(feature), true).getBoolean(true));
|
||||
features.put(
|
||||
featureName(feature),
|
||||
config.get("features", featureName(feature), true)
|
||||
.getBoolean(true));
|
||||
}
|
||||
|
||||
if (config.hasChanged()) {
|
||||
@@ -300,7 +324,9 @@ public class Configurations {
|
||||
* Makes the old camelCase names from the new CONSTANT_CASE names
|
||||
*/
|
||||
public static String featureName(Features feature) {
|
||||
String[] words = feature.name().toLowerCase(Locale.ENGLISH).split("_");
|
||||
String[] words = feature.name()
|
||||
.toLowerCase(Locale.ENGLISH)
|
||||
.split("_");
|
||||
if (words.length == 1) {
|
||||
return words[0];
|
||||
}
|
||||
|
||||
@@ -56,12 +56,8 @@ public class EntityCloudInABottle extends EntityThrowable {
|
||||
|
||||
generate(worldObj, rand, x, y, z, 40);
|
||||
|
||||
worldObj.playAuxSFX(
|
||||
2002,
|
||||
(int) Math.round(this.posX),
|
||||
(int) Math.round(this.posY),
|
||||
(int) Math.round(this.posZ),
|
||||
2);
|
||||
worldObj
|
||||
.playAuxSFX(2002, (int) Math.round(this.posX), (int) Math.round(this.posY), (int) Math.round(this.posZ), 2);
|
||||
setDead();
|
||||
}
|
||||
|
||||
@@ -96,9 +92,9 @@ public class EntityCloudInABottle extends EntityThrowable {
|
||||
for (int j2 = x; j2 < x + random.nextInt(4) + 1; j2++) {
|
||||
for (int k2 = y; k2 < y + random.nextInt(1) + 2; k2++) {
|
||||
for (int l2 = z; l2 < z + random.nextInt(4) + 1; l2++) {
|
||||
if (world.getBlock(j2, k2, l2).isAir(world, j2, k2, l2)
|
||||
&& Math.abs(j2 - x) + Math.abs(k2 - y) + Math.abs(l2 - z)
|
||||
< 4 * 1 + random.nextInt(2)) {
|
||||
if (world.getBlock(j2, k2, l2)
|
||||
.isAir(world, j2, k2, l2)
|
||||
&& Math.abs(j2 - x) + Math.abs(k2 - y) + Math.abs(l2 - z) < 4 * 1 + random.nextInt(2)) {
|
||||
world.setBlock(j2, k2, l2, ChiselBlocks.cloud);
|
||||
count++;
|
||||
}
|
||||
|
||||
@@ -7,11 +7,11 @@ import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import team.chisel.block.BlockSnakestoneObsidian;
|
||||
import team.chisel.init.ChiselItems;
|
||||
import team.chisel.utils.General;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class EntityBallOMossFX extends EntityFX {
|
||||
|
||||
@@ -114,7 +114,7 @@ public class EntityBallOMossFX extends EntityFX {
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ,
|
||||
float rotYZ, float rotXY) {
|
||||
float rotYZ, float rotXY) {
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 771);
|
||||
|
||||
@@ -38,7 +38,7 @@ public class EntityGrimstoneFX extends EntityFX {
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ,
|
||||
float rotYZ, float rotXY) {
|
||||
float rotYZ, float rotXY) {
|
||||
particleScale = 0.25f + initialScale * (float) Math.sin((particleAge + angleOffset) / 180.f);
|
||||
|
||||
if (particleAge < fadetime) particleAlpha = particleAge / fadetime;
|
||||
|
||||
@@ -38,7 +38,7 @@ public class EntityHolystoneFX extends EntityFX {
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ,
|
||||
float rotYZ, float rotXY) {
|
||||
float rotYZ, float rotXY) {
|
||||
particleScale = 0.25f + initialScale * (float) Math.sin((particleAge + angleOffset) / 180.f);
|
||||
|
||||
if (particleAge < fadetime) particleAlpha = particleAge / fadetime;
|
||||
|
||||
@@ -61,7 +61,7 @@ public class EntitySnakestoneObsidianFX extends EntityFX {
|
||||
noClip = true;
|
||||
|
||||
setParticleIcon(
|
||||
BlockSnakestoneObsidian.particles[General.rand.nextInt(BlockSnakestoneObsidian.particles.length)]);
|
||||
BlockSnakestoneObsidian.particles[General.rand.nextInt(BlockSnakestoneObsidian.particles.length)]);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -71,7 +71,7 @@ public class EntitySnakestoneObsidianFX extends EntityFX {
|
||||
|
||||
@Override
|
||||
public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ,
|
||||
float rotYZ, float rotXY) {
|
||||
float rotYZ, float rotXY) {
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 771);
|
||||
|
||||
@@ -2,9 +2,9 @@ package team.chisel.init;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.block.*;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
|
||||
@ObjectHolder(Chisel.MOD_ID)
|
||||
public final class ChiselBlocks {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package team.chisel.init;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.item.ItemBallOMoss;
|
||||
import team.chisel.item.ItemCloudInABottle;
|
||||
import team.chisel.item.ItemSmashingRock;
|
||||
import team.chisel.item.ItemUpgrade;
|
||||
import team.chisel.item.chisel.ItemChisel;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.ObjectHolder;
|
||||
|
||||
@ObjectHolder(Chisel.MOD_ID)
|
||||
public final class ChiselItems {
|
||||
|
||||
@@ -4,10 +4,10 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import team.chisel.Features;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||
|
||||
import team.chisel.Features;
|
||||
|
||||
public class TabsInit {
|
||||
|
||||
private static boolean atLeastOneModIsLoaded = false;
|
||||
|
||||
@@ -103,12 +103,12 @@ public class ContainerAutoChisel extends Container {
|
||||
ItemStack ret = super.slotClick(slotId, p_75144_2_, p_75144_3_, player);
|
||||
|
||||
if (!player.worldObj.isRemote && slot.slotNumber == TileEntityAutoChisel.BASE
|
||||
&& !ItemStack.areItemStacksEqual(stack, slot.getStack())) {
|
||||
&& !ItemStack.areItemStacksEqual(stack, slot.getStack())) {
|
||||
int chiseled = stack == null ? 0
|
||||
: slot.getStack() == null ? stack.stackSize : stack.stackSize - slot.getStack().stackSize;
|
||||
: slot.getStack() == null ? stack.stackSize : stack.stackSize - slot.getStack().stackSize;
|
||||
PacketHandler.INSTANCE.sendToDimension(
|
||||
new MessageAutoChisel(autoChisel, chiseled, false, false),
|
||||
player.worldObj.provider.dimensionId);
|
||||
new MessageAutoChisel(autoChisel, chiseled, false, false),
|
||||
player.worldObj.provider.dimensionId);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -137,15 +137,14 @@ public class ContainerAutoChisel extends Container {
|
||||
if (par1ItemStack.isStackable()) {
|
||||
|
||||
while (par1ItemStack.stackSize > 0
|
||||
&& (!reversOrder && checkIndex < toIndex || reversOrder && checkIndex >= fromIndex)) {
|
||||
&& (!reversOrder && checkIndex < toIndex || reversOrder && checkIndex >= fromIndex)) {
|
||||
slot = (Slot) this.inventorySlots.get(checkIndex);
|
||||
itemstack1 = slot.getStack();
|
||||
|
||||
if (itemstack1 != null && itemstack1.getItem() == par1ItemStack.getItem()
|
||||
&& (!par1ItemStack.getHasSubtypes()
|
||||
|| par1ItemStack.getItemDamage() == itemstack1.getItemDamage())
|
||||
&& ItemStack.areItemStackTagsEqual(par1ItemStack, itemstack1)
|
||||
&& slot.isItemValid(par1ItemStack)) {
|
||||
&& (!par1ItemStack.getHasSubtypes() || par1ItemStack.getItemDamage() == itemstack1.getItemDamage())
|
||||
&& ItemStack.areItemStackTagsEqual(par1ItemStack, itemstack1)
|
||||
&& slot.isItemValid(par1ItemStack)) {
|
||||
|
||||
int mergedSize = itemstack1.stackSize + par1ItemStack.stackSize;
|
||||
int maxStackSize = Math.min(par1ItemStack.getMaxStackSize(), slot.getSlotStackLimit());
|
||||
|
||||
@@ -7,12 +7,12 @@ import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingRegistry;
|
||||
|
||||
import team.chisel.carving.Carving;
|
||||
import team.chisel.item.chisel.ItemChisel;
|
||||
import team.chisel.utils.General;
|
||||
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingRegistry;
|
||||
|
||||
public class ContainerChisel extends Container {
|
||||
|
||||
public final InventoryChiselSelection inventory;
|
||||
@@ -33,13 +33,7 @@ public class ContainerChisel extends Container {
|
||||
// selection slots
|
||||
for (int i = 0; i < InventoryChiselSelection.normalSlots; i++) {
|
||||
addSlotToContainer(
|
||||
new SlotChiselSelection(
|
||||
this,
|
||||
inventory,
|
||||
inventory,
|
||||
i,
|
||||
left + ((i % 10) * 18),
|
||||
top + ((i / 10) * 18)));
|
||||
new SlotChiselSelection(this, inventory, inventory, i, left + ((i % 10) * 18), top + ((i / 10) * 18)));
|
||||
}
|
||||
|
||||
// main slot
|
||||
@@ -103,10 +97,10 @@ public class ContainerChisel extends Container {
|
||||
|
||||
if (slotIdx > InventoryChiselSelection.normalSlots) {
|
||||
if (!this.mergeItemStack(
|
||||
itemstack1,
|
||||
InventoryChiselSelection.normalSlots,
|
||||
InventoryChiselSelection.normalSlots + 1,
|
||||
false)) {
|
||||
itemstack1,
|
||||
InventoryChiselSelection.normalSlots,
|
||||
InventoryChiselSelection.normalSlots + 1,
|
||||
false)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
@@ -116,10 +110,10 @@ public class ContainerChisel extends Container {
|
||||
entity.inventory.setItemStack(null);
|
||||
|
||||
if (!this.mergeItemStack(
|
||||
itemstack1,
|
||||
InventoryChiselSelection.normalSlots + 1,
|
||||
InventoryChiselSelection.normalSlots + 1 + 36,
|
||||
false)) {
|
||||
itemstack1,
|
||||
InventoryChiselSelection.normalSlots + 1,
|
||||
InventoryChiselSelection.normalSlots + 1 + 36,
|
||||
false)) {
|
||||
entity.inventory.setItemStack(itemstack1);
|
||||
return null;
|
||||
}
|
||||
@@ -154,7 +148,7 @@ public class ContainerChisel extends Container {
|
||||
@Override
|
||||
protected boolean mergeItemStack(ItemStack par1ItemStack, int fromIndex, int toIndex, boolean reversOrder) {
|
||||
return ((Slot) this.inventorySlots.get(reversOrder ? toIndex - 1 : fromIndex)).isItemValid(par1ItemStack)
|
||||
&& super.mergeItemStack(par1ItemStack, fromIndex, toIndex, reversOrder);
|
||||
&& super.mergeItemStack(par1ItemStack, fromIndex, toIndex, reversOrder);
|
||||
}
|
||||
|
||||
public void onChiselSlotChanged() {
|
||||
|
||||
@@ -78,7 +78,8 @@ public class ContainerPresent extends Container {
|
||||
public void detectAndSendChanges() {
|
||||
TileEntityPresent te = (TileEntityPresent) lower;
|
||||
if (te != null && te.hasWorldObj() && !te.getWorldObj().isRemote) {
|
||||
if (te.getWorldObj().getTileEntity(te.xCoord, te.yCoord, te.zCoord) != te) isContainerValid = false;
|
||||
if (te.getWorldObj()
|
||||
.getTileEntity(te.xCoord, te.yCoord, te.zCoord) != te) isContainerValid = false;
|
||||
}
|
||||
super.detectAndSendChanges();
|
||||
}
|
||||
|
||||
@@ -9,11 +9,11 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemTool;
|
||||
|
||||
import com.cricketcraft.chisel.api.IChiselItem;
|
||||
|
||||
import team.chisel.item.chisel.ItemChisel;
|
||||
import team.chisel.utils.General;
|
||||
|
||||
import com.cricketcraft.chisel.api.IChiselItem;
|
||||
|
||||
public class InventoryChiselSelection implements IInventory {
|
||||
|
||||
ItemStack chisel;
|
||||
@@ -135,15 +135,17 @@ public class InventoryChiselSelection implements IInventory {
|
||||
if (Block.getBlockFromItem(item) == null) return;
|
||||
|
||||
if (!((IChiselItem) chisel.getItem())
|
||||
.canChisel(container.playerInventory.player.worldObj, chisel, General.getVariation(chiseledItem)))
|
||||
return;
|
||||
.canChisel(container.playerInventory.player.worldObj, chisel, General.getVariation(chiseledItem))) return;
|
||||
|
||||
List<ItemStack> list = container.carving.getItemsForChiseling(chiseledItem);
|
||||
maxScroll = list.size();
|
||||
int activeVariations = 0;
|
||||
while (activeVariations < normalSlots && activeVariations + currentScroll < list.size()) {
|
||||
if (Block.blockRegistry.getNameForObject(
|
||||
Block.getBlockFromItem(list.get(activeVariations + currentScroll).getItem())) != null) {
|
||||
Block.getBlockFromItem(
|
||||
list.get(activeVariations + currentScroll)
|
||||
.getItem()))
|
||||
!= null) {
|
||||
inventory[activeVariations] = list.get(activeVariations + currentScroll);
|
||||
activeVariations++;
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ public class SlotChiselInput extends Slot {
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack itemstack) {
|
||||
return !container.finished && !container.carving.getItemsForChiseling(itemstack).isEmpty()
|
||||
&& super.isItemValid(itemstack);
|
||||
return !container.finished && !container.carving.getItemsForChiseling(itemstack)
|
||||
.isEmpty() && super.isItemValid(itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,20 +6,20 @@ import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
import com.cricketcraft.chisel.api.IChiselItem;
|
||||
import com.cricketcraft.chisel.api.Statistics;
|
||||
|
||||
import team.chisel.carving.Carving;
|
||||
import team.chisel.utils.General;
|
||||
import team.chisel.utils.GeneralClient;
|
||||
|
||||
import com.cricketcraft.chisel.api.IChiselItem;
|
||||
import com.cricketcraft.chisel.api.Statistics;
|
||||
|
||||
public class SlotChiselSelection extends Slot {
|
||||
|
||||
private final ContainerChisel container;
|
||||
private final InventoryChiselSelection selInventory;
|
||||
|
||||
public SlotChiselSelection(ContainerChisel container, InventoryChiselSelection inv, IInventory iinventory, int i,
|
||||
int j, int k) {
|
||||
int j, int k) {
|
||||
super(iinventory, i, j, k);
|
||||
|
||||
this.container = container;
|
||||
@@ -53,17 +53,17 @@ public class SlotChiselSelection extends Slot {
|
||||
if (selInventory.inventory[InventoryChiselSelection.normalSlots] == null) return;
|
||||
|
||||
player.inventory.setItemStack(
|
||||
new ItemStack(
|
||||
itemstack.getItem(),
|
||||
selInventory.inventory[InventoryChiselSelection.normalSlots].stackSize,
|
||||
itemstack.getItemDamage()));
|
||||
new ItemStack(
|
||||
itemstack.getItem(),
|
||||
selInventory.inventory[InventoryChiselSelection.normalSlots].stackSize,
|
||||
itemstack.getItemDamage()));
|
||||
selInventory.setInventorySlotContents(InventoryChiselSelection.normalSlots, null);
|
||||
}
|
||||
|
||||
selInventory.updateItems();
|
||||
|
||||
if (((IChiselItem) container.chisel.getItem())
|
||||
.onChisel(player.worldObj, container.chisel, General.getVariation(crafted))) {
|
||||
.onChisel(player.worldObj, container.chisel, General.getVariation(crafted))) {
|
||||
container.chisel.damageItem(1, player);
|
||||
if (container.chisel.stackSize <= 0) {
|
||||
player.inventory.mainInventory[player.inventory.currentItem] = null;
|
||||
@@ -73,11 +73,11 @@ public class SlotChiselSelection extends Slot {
|
||||
if (player.worldObj.isRemote) {
|
||||
String sound = Carving.chisel.getVariationSound(crafted.getItem(), crafted.getItemDamage());
|
||||
GeneralClient.playChiselSound(
|
||||
player.worldObj,
|
||||
MathHelper.floor_double(player.posX),
|
||||
MathHelper.floor_double(player.posY),
|
||||
MathHelper.floor_double(player.posZ),
|
||||
sound);
|
||||
player.worldObj,
|
||||
MathHelper.floor_double(player.posX),
|
||||
MathHelper.floor_double(player.posY),
|
||||
MathHelper.floor_double(player.posZ),
|
||||
sound);
|
||||
} else {
|
||||
container.playerInventory.player.addStat(Statistics.blocksChiseled, crafted.stackSize);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public class ItemBallOMoss extends BaseItem {
|
||||
}
|
||||
|
||||
if (par2World.isRemote) par2World
|
||||
.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
|
||||
if (!par2World.isRemote) {
|
||||
par2World.spawnEntityInWorld(new EntityBallOMoss(par2World, par3EntityPlayer));
|
||||
|
||||
@@ -10,12 +10,12 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import team.chisel.config.Configurations;
|
||||
import team.chisel.utils.General;
|
||||
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||
|
||||
import team.chisel.config.Configurations;
|
||||
import team.chisel.utils.General;
|
||||
|
||||
public class ItemCarvable extends ItemBlock {
|
||||
|
||||
public ItemCarvable(Block block) {
|
||||
@@ -31,7 +31,8 @@ public class ItemCarvable extends ItemBlock {
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
return Block.getBlockFromItem(this).getIcon(2, damage);
|
||||
return Block.getBlockFromItem(this)
|
||||
.getIcon(2, damage);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
|
||||
@@ -21,7 +21,7 @@ public class ItemCarvableSlab extends ItemCarvable {
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hx,
|
||||
float hy, float hz) {
|
||||
float hy, float hz) {
|
||||
BlockCarvableSlab block = (BlockCarvableSlab) Block.getBlockFromItem(this);
|
||||
int meta = stack.getItemDamage();
|
||||
|
||||
@@ -38,8 +38,8 @@ public class ItemCarvableSlab extends ItemCarvable {
|
||||
boolean metaEquals = world.getBlockMetadata(x2, y2, z2) == meta;
|
||||
// if the metadata at the place target matches, and the block there matches either the top of bottom slab, try
|
||||
// to fill in the rest of the block
|
||||
if (metaEquals && ((at == block.top && (hy <= 0.5D || hy == 1.0D))
|
||||
|| (at == block.bottom && (hy > 0.5D || hy == 0)))) {
|
||||
if (metaEquals
|
||||
&& ((at == block.top && (hy <= 0.5D || hy == 1.0D)) || (at == block.bottom && (hy > 0.5D || hy == 0)))) {
|
||||
place(stack, world, x2, y2, z2, block.master, meta);
|
||||
return true;
|
||||
}
|
||||
@@ -47,7 +47,7 @@ public class ItemCarvableSlab extends ItemCarvable {
|
||||
// else if the block clicked on is a top or bottom slab of this type, try to fill in that block if possible
|
||||
boolean clickedMetaEquals = world.getBlockMetadata(x, y, z) == meta;
|
||||
if (clickedMetaEquals && ((clicked == block.bottom && dir == ForgeDirection.UP)
|
||||
|| (clicked == block.top && dir == ForgeDirection.DOWN))) {
|
||||
|| (clicked == block.top && dir == ForgeDirection.DOWN))) {
|
||||
place(stack, world, x, y, z, block.master, meta);
|
||||
return true;
|
||||
}
|
||||
@@ -71,11 +71,11 @@ public class ItemCarvableSlab extends ItemCarvable {
|
||||
world.setBlock(x, y, z, toPlace, metadata, 2);
|
||||
stack.stackSize -= 1;
|
||||
world.playSoundEffect(
|
||||
x + 0.5f,
|
||||
y + 0.5f,
|
||||
z + 0.5f,
|
||||
this.field_150939_a.stepSound.func_150496_b(),
|
||||
(this.field_150939_a.stepSound.getVolume() + 1.0F) / 2.0F,
|
||||
this.field_150939_a.stepSound.getPitch() * 0.8F);
|
||||
x + 0.5f,
|
||||
y + 0.5f,
|
||||
z + 0.5f,
|
||||
this.field_150939_a.stepSound.func_150496_b(),
|
||||
(this.field_150939_a.stepSound.getVolume() + 1.0F) / 2.0F,
|
||||
this.field_150939_a.stepSound.getPitch() * 0.8F);
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class ItemCloudInABottle extends BaseItem {
|
||||
}
|
||||
|
||||
if (par2World.isRemote) par2World
|
||||
.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
|
||||
if (!par2World.isRemote) {
|
||||
par2World.spawnEntityInWorld(new EntityCloudInABottle(par2World, par3EntityPlayer));
|
||||
|
||||
@@ -20,7 +20,7 @@ public class ItemSmashingRock extends BaseItem {
|
||||
}
|
||||
|
||||
if (par2World.isRemote) par2World
|
||||
.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
|
||||
if (!par2World.isRemote) {
|
||||
par2World.spawnEntityInWorld(new EntitySmashingRock(par2World, par3EntityPlayer));
|
||||
|
||||
@@ -33,7 +33,10 @@ public class ItemUpgrade extends BaseItem {
|
||||
public void registerIcons(IIconRegister reg) {
|
||||
Upgrade[] upgrades = Upgrade.values();
|
||||
for (int i = 0; i < upgrades.length; i++) {
|
||||
this.icons[i] = reg.registerIcon(Chisel.MOD_ID + ":upgrade_" + upgrades[i].name().toLowerCase());
|
||||
this.icons[i] = reg.registerIcon(
|
||||
Chisel.MOD_ID + ":upgrade_"
|
||||
+ upgrades[i].name()
|
||||
.toLowerCase());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,10 +13,6 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.carving.Carving;
|
||||
import team.chisel.utils.General;
|
||||
|
||||
import com.cricketcraft.chisel.api.IChiselItem;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingGroup;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
||||
@@ -27,6 +23,9 @@ import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ServerTickEvent;
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.carving.Carving;
|
||||
import team.chisel.utils.General;
|
||||
|
||||
public final class ChiselController {
|
||||
|
||||
@@ -60,7 +59,9 @@ public final class ChiselController {
|
||||
|
||||
public void preInit() {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
FMLCommonHandler.instance()
|
||||
.bus()
|
||||
.register(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@@ -98,8 +99,7 @@ public final class ChiselController {
|
||||
|
||||
List<ICarvingVariation> list = group.getVariations();
|
||||
|
||||
main:
|
||||
for (ItemStack stack : OreDictionary.getOres(group.getOreName())) {
|
||||
main: for (ItemStack stack : OreDictionary.getOres(group.getOreName())) {
|
||||
ICarvingVariation v = General.getVariation(stack);
|
||||
for (ICarvingVariation check : list) {
|
||||
if (check.getBlock() == v.getBlock() && check.getBlockMeta() == v.getBlockMeta()) {
|
||||
@@ -144,7 +144,8 @@ public final class ChiselController {
|
||||
// This still shows the block being broken, but it's better than nothing
|
||||
@SubscribeEvent
|
||||
public void onBlockBreak(BlockEvent.BreakEvent event) {
|
||||
ItemStack stack = event.getPlayer().getCurrentEquippedItem();
|
||||
ItemStack stack = event.getPlayer()
|
||||
.getCurrentEquippedItem();
|
||||
if (event.getPlayer().capabilities.isCreativeMode && stack != null && stack.getItem() instanceof IChiselItem) {
|
||||
event.setCanceled(true);
|
||||
}
|
||||
|
||||
@@ -8,21 +8,21 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import team.chisel.network.PacketHandler;
|
||||
import team.chisel.network.message.MessageChiselSound;
|
||||
|
||||
import com.cricketcraft.chisel.api.IChiselItem;
|
||||
import com.cricketcraft.chisel.api.Statistics;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
||||
import com.cricketcraft.chisel.api.carving.IChiselMode;
|
||||
|
||||
import team.chisel.network.PacketHandler;
|
||||
import team.chisel.network.message.MessageChiselSound;
|
||||
|
||||
public enum ChiselMode implements IChiselMode {
|
||||
|
||||
SINGLE {
|
||||
|
||||
@Override
|
||||
public void chiselAll(EntityPlayer player, World world, int x, int y, int z, ForgeDirection side,
|
||||
ICarvingVariation variation) {
|
||||
ICarvingVariation variation) {
|
||||
setVariation(player, world, x, y, z, world.getBlock(x, y, z), world.getBlockMetadata(x, y, z), variation);
|
||||
}
|
||||
},
|
||||
@@ -30,7 +30,7 @@ public enum ChiselMode implements IChiselMode {
|
||||
|
||||
@Override
|
||||
public void chiselAll(EntityPlayer player, World world, int x, int y, int z, ForgeDirection side,
|
||||
ICarvingVariation variation) {
|
||||
ICarvingVariation variation) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
for (int dx = -1; dx <= 1; dx++) {
|
||||
@@ -50,7 +50,7 @@ public enum ChiselMode implements IChiselMode {
|
||||
|
||||
@Override
|
||||
public void chiselAll(EntityPlayer player, World world, int x, int y, int z, ForgeDirection side,
|
||||
ICarvingVariation variation) {
|
||||
ICarvingVariation variation) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
int facing = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
@@ -71,7 +71,7 @@ public enum ChiselMode implements IChiselMode {
|
||||
|
||||
@Override
|
||||
public void chiselAll(EntityPlayer player, World world, int x, int y, int z, ForgeDirection side,
|
||||
ICarvingVariation variation) {
|
||||
ICarvingVariation variation) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
int facing = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
@@ -97,7 +97,7 @@ public enum ChiselMode implements IChiselMode {
|
||||
* Assumes that the player is holding a chisel
|
||||
*/
|
||||
private static void setVariation(EntityPlayer player, World world, int x, int y, int z, Block origBlock,
|
||||
int origMeta, ICarvingVariation v) {
|
||||
int origMeta, ICarvingVariation v) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
ItemStack held = player.getCurrentEquippedItem();
|
||||
@@ -116,9 +116,10 @@ public enum ChiselMode implements IChiselMode {
|
||||
}
|
||||
player.addStat(Statistics.blocksChiseled, 1);
|
||||
boolean breakChisel = false;
|
||||
if (((IChiselItem) player.getCurrentEquippedItem().getItem())
|
||||
.onChisel(world, player.getCurrentEquippedItem(), v)) {
|
||||
player.getCurrentEquippedItem().damageItem(1, player);
|
||||
if (((IChiselItem) player.getCurrentEquippedItem()
|
||||
.getItem()).onChisel(world, player.getCurrentEquippedItem(), v)) {
|
||||
player.getCurrentEquippedItem()
|
||||
.damageItem(1, player);
|
||||
if (player.getCurrentEquippedItem().stackSize <= 0) {
|
||||
player.inventory.mainInventory[player.inventory.currentItem] = null;
|
||||
breakChisel = true;
|
||||
|
||||
@@ -16,16 +16,16 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.carving.Carving;
|
||||
import team.chisel.config.Configurations;
|
||||
|
||||
import com.cricketcraft.chisel.api.IChiselItem;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingRegistry;
|
||||
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import team.chisel.Chisel;
|
||||
import team.chisel.carving.Carving;
|
||||
import team.chisel.config.Configurations;
|
||||
|
||||
public class ItemChisel extends Item implements IChiselItem {
|
||||
|
||||
public enum ChiselType {
|
||||
@@ -52,11 +52,21 @@ public class ItemChisel extends Item implements IChiselItem {
|
||||
super();
|
||||
this.type = type;
|
||||
setMaxStackSize(1);
|
||||
setTextureName(Chisel.MOD_ID + ":chisel_" + type.name().toLowerCase(Locale.ENGLISH));
|
||||
setTextureName(
|
||||
Chisel.MOD_ID + ":chisel_"
|
||||
+ type.name()
|
||||
.toLowerCase(Locale.ENGLISH));
|
||||
if (type == ChiselType.NETHERSTAR && Chisel.gtnhLoaded) {
|
||||
setUnlocalizedName(Chisel.MOD_ID + ".chisel_" + type.name().toLowerCase() + ".gtnh");
|
||||
setUnlocalizedName(
|
||||
Chisel.MOD_ID + ".chisel_"
|
||||
+ type.name()
|
||||
.toLowerCase()
|
||||
+ ".gtnh");
|
||||
} else {
|
||||
setUnlocalizedName(Chisel.MOD_ID + ".chisel_" + type.name().toLowerCase());
|
||||
setUnlocalizedName(
|
||||
Chisel.MOD_ID + ".chisel_"
|
||||
+ type.name()
|
||||
.toLowerCase());
|
||||
}
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
@@ -76,13 +86,17 @@ public class ItemChisel extends Item implements IChiselItem {
|
||||
public boolean getIsRepairable(ItemStack damagedItem, ItemStack repairMaterial) {
|
||||
switch (type) {
|
||||
case DIAMOND:
|
||||
return repairMaterial.getItem().equals(Items.diamond);
|
||||
return repairMaterial.getItem()
|
||||
.equals(Items.diamond);
|
||||
case IRON:
|
||||
return repairMaterial.getItem().equals(Items.iron_ingot);
|
||||
return repairMaterial.getItem()
|
||||
.equals(Items.iron_ingot);
|
||||
case OBSIDIAN:
|
||||
return repairMaterial.getItem().equals(Item.getItemFromBlock(Blocks.obsidian));
|
||||
return repairMaterial.getItem()
|
||||
.equals(Item.getItemFromBlock(Blocks.obsidian));
|
||||
case NETHERSTAR:
|
||||
return repairMaterial.getItem().equals(Items.nether_star);
|
||||
return repairMaterial.getItem()
|
||||
.equals(Items.nether_star);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -97,14 +111,14 @@ public class ItemChisel extends Item implements IChiselItem {
|
||||
String modes = I18n.format(base + "modes");
|
||||
list.add(gui);
|
||||
if (type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN
|
||||
|| type == ChiselType.NETHERSTAR
|
||||
|| Configurations.ironChiselCanLeftClick) {
|
||||
|| type == ChiselType.NETHERSTAR
|
||||
|| Configurations.ironChiselCanLeftClick) {
|
||||
list.add(lc1);
|
||||
list.add(lc2);
|
||||
}
|
||||
if (type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN
|
||||
|| type == ChiselType.NETHERSTAR
|
||||
|| Configurations.ironChiselHasModes) {
|
||||
|| type == ChiselType.NETHERSTAR
|
||||
|| Configurations.ironChiselHasModes) {
|
||||
list.add("");
|
||||
list.add(modes);
|
||||
}
|
||||
@@ -120,8 +134,8 @@ public class ItemChisel extends Item implements IChiselItem {
|
||||
public Multimap getAttributeModifiers(ItemStack stack) {
|
||||
Multimap<String, AttributeModifier> multimap = HashMultimap.create();
|
||||
multimap.put(
|
||||
SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
|
||||
new AttributeModifier(field_111210_e, "Chisel Damage", type.attackDamage, 0));
|
||||
SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
|
||||
new AttributeModifier(field_111210_e, "Chisel Damage", type.attackDamage, 0));
|
||||
return multimap;
|
||||
}
|
||||
|
||||
@@ -149,15 +163,15 @@ public class ItemChisel extends Item implements IChiselItem {
|
||||
@Override
|
||||
public boolean canChiselBlock(World world, EntityPlayer player, int x, int y, int z, Block block, int metadata) {
|
||||
return type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN
|
||||
|| type == ChiselType.NETHERSTAR
|
||||
|| Configurations.ironChiselCanLeftClick;
|
||||
|| type == ChiselType.NETHERSTAR
|
||||
|| Configurations.ironChiselCanLeftClick;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasModes(ItemStack chisel) {
|
||||
return type == ChiselType.DIAMOND || type == ChiselType.OBSIDIAN
|
||||
|| type == ChiselType.NETHERSTAR
|
||||
|| Configurations.ironChiselHasModes;
|
||||
|| type == ChiselType.NETHERSTAR
|
||||
|| Configurations.ironChiselHasModes;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,6 +4,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import team.chisel.block.tileentity.TileEntityAutoChisel;
|
||||
import team.chisel.block.tileentity.TileEntityPresent;
|
||||
import team.chisel.client.gui.GuiAutoChisel;
|
||||
@@ -13,7 +14,6 @@ import team.chisel.inventory.ContainerAutoChisel;
|
||||
import team.chisel.inventory.ContainerChisel;
|
||||
import team.chisel.inventory.ContainerPresent;
|
||||
import team.chisel.inventory.InventoryChiselSelection;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
|
||||
public class ChiselGuiHandler implements IGuiHandler {
|
||||
|
||||
@@ -22,8 +22,8 @@ public class ChiselGuiHandler implements IGuiHandler {
|
||||
switch (ID) {
|
||||
case 0:
|
||||
return new ContainerChisel(
|
||||
player.inventory,
|
||||
new InventoryChiselSelection(player.getCurrentEquippedItem()));
|
||||
player.inventory,
|
||||
new InventoryChiselSelection(player.getCurrentEquippedItem()));
|
||||
case 1:
|
||||
TileEntity tileentity = world.getTileEntity(x, y, z);
|
||||
if (tileentity instanceof TileEntityAutoChisel)
|
||||
|
||||
Loaded 100 of 114 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user