mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-19 20:09:46 +00:00
Full cleanup and format. Remove all warnings.
This commit is contained in:
1 parent
9ff61fe0c0
commit
444fdbfe19
78 files changed
+818
-805
No files matched your search
@@ -3,5 +3,5 @@ package com.cricketcraft.chisel.api;
|
||||
public class ChiselAPIProps {
|
||||
|
||||
public static final String VERSION = "0.1.0";
|
||||
public static String MOD_ID = null; // Set by Chisel
|
||||
public static String MOD_ID = null; // Set by Chisel
|
||||
}
|
||||
@@ -1,18 +1,16 @@
|
||||
package com.cricketcraft.chisel.api;
|
||||
|
||||
import com.cricketcraft.chisel.api.carving.IChiselMode;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.cricketcraft.chisel.api.carving.IChiselMode;
|
||||
|
||||
/**
|
||||
* Implement this on chisel items which require more control over chisel modes
|
||||
* (including adding new modes).
|
||||
* Implement this on chisel items which require more control over chisel modes (including adding new modes).
|
||||
*/
|
||||
public interface IAdvancedChisel {
|
||||
|
||||
/**
|
||||
* Gets the next mode the button in the GUI should switch to given the
|
||||
* current mode.
|
||||
* Gets the next mode the button in the GUI should switch to given the current mode.
|
||||
*
|
||||
* @param stack
|
||||
* The {@link ItemStack} representing the chisel
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.cricketcraft.chisel.api;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
@@ -32,6 +31,7 @@ public interface ICarvable extends ICTMBlock<IVariationInfo> {
|
||||
* The metadata of the block
|
||||
* @return The {@link ISubmapManager} that represents this block in the world.
|
||||
*/
|
||||
@Override
|
||||
public IVariationInfo getManager(IBlockAccess world, int x, int y, int z, int metadata);
|
||||
|
||||
/**
|
||||
@@ -39,5 +39,6 @@ public interface ICarvable extends ICTMBlock<IVariationInfo> {
|
||||
*
|
||||
* @return A {@link ISubmapManager}
|
||||
*/
|
||||
@Override
|
||||
public IVariationInfo getManager(int meta);
|
||||
}
|
||||
@@ -5,36 +5,45 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* To be implemented on blocks that "hide" another block inside, so connected textuers can still be
|
||||
* accomplished.
|
||||
* To be implemented on blocks that "hide" another block inside, so connected textuers can still be accomplished.
|
||||
*/
|
||||
public interface IFacade
|
||||
{
|
||||
/**
|
||||
* Gets the block this facade is acting as.
|
||||
*
|
||||
* @param world {@link World}
|
||||
* @param x X coord of your block
|
||||
* @param y Y coord of your block
|
||||
* @param z Z coord of your block
|
||||
* @param side The side being rendered, NOT the side being connected from.
|
||||
* <p>
|
||||
* This value can be -1 if no side is specified. Please handle this appropriately.
|
||||
* @return The block inside of your facade block.
|
||||
*/
|
||||
Block getFacade(IBlockAccess world, int x, int y, int z, int side);
|
||||
public interface IFacade {
|
||||
|
||||
/**
|
||||
* Gets the metadata of the block that this facade is acting as.
|
||||
*
|
||||
* @param world {@link World}
|
||||
* @param x X coord of your block
|
||||
* @param y Y coord of your block
|
||||
* @param z Z coord of your block
|
||||
* @param side The side being rendered, NOT the side being connected from.
|
||||
* <p>
|
||||
* This value can be -1 if no side is specified. Please handle this appropriately.
|
||||
* @return The metadata of your facade block.
|
||||
*/
|
||||
int getFacadeMetadata(IBlockAccess world, int x, int y, int z, int side);
|
||||
/**
|
||||
* Gets the block this facade is acting as.
|
||||
*
|
||||
* @param world
|
||||
* {@link World}
|
||||
* @param x
|
||||
* X coord of your block
|
||||
* @param y
|
||||
* Y coord of your block
|
||||
* @param z
|
||||
* Z coord of your block
|
||||
* @param side
|
||||
* The side being rendered, NOT the side being connected from.
|
||||
* <p>
|
||||
* This value can be -1 if no side is specified. Please handle this appropriately.
|
||||
* @return The block inside of your facade block.
|
||||
*/
|
||||
Block getFacade(IBlockAccess world, int x, int y, int z, int side);
|
||||
|
||||
/**
|
||||
* Gets the metadata of the block that this facade is acting as.
|
||||
*
|
||||
* @param world
|
||||
* {@link World}
|
||||
* @param x
|
||||
* X coord of your block
|
||||
* @param y
|
||||
* Y coord of your block
|
||||
* @param z
|
||||
* Z coord of your block
|
||||
* @param side
|
||||
* The side being rendered, NOT the side being connected from.
|
||||
* <p>
|
||||
* This value can be -1 if no side is specified. Please handle this appropriately.
|
||||
* @return The metadata of your facade block.
|
||||
*/
|
||||
int getFacadeMetadata(IBlockAccess world, int x, int y, int z, int side);
|
||||
}
|
||||
@@ -6,10 +6,10 @@ import net.minecraft.util.ChatComponentTranslation;
|
||||
|
||||
public class Statistics {
|
||||
|
||||
public static StatBase blocksChiseled = (new StatBasic("stat.blockChiseled", new ChatComponentTranslation("stat.blockChiseled", new Object[0])));
|
||||
public static StatBase blocksChiseled = (new StatBasic("stat.blockChiseled", new ChatComponentTranslation("stat.blockChiseled", new Object[0])));
|
||||
|
||||
public static void init(){
|
||||
blocksChiseled.initIndependentStat();
|
||||
blocksChiseled.registerStat();
|
||||
}
|
||||
public static void init() {
|
||||
blocksChiseled.initIndependentStat();
|
||||
blocksChiseled.registerStat();
|
||||
}
|
||||
}
|
||||
@@ -26,42 +26,42 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class CarvableHelper {
|
||||
|
||||
|
||||
public static Class<? extends ItemBlock> itemCarvableClass = null;
|
||||
|
||||
private Block theBlock;
|
||||
|
||||
|
||||
public ArrayList<IVariationInfo> infoList = new ArrayList<IVariationInfo>();
|
||||
IVariationInfo[] infoMap = new IVariationInfo[16];
|
||||
public boolean forbidChiseling = false;
|
||||
|
||||
|
||||
public CarvableHelper(Block block) {
|
||||
this.theBlock = block;
|
||||
}
|
||||
|
||||
public void addVariation(String description, int metadata, ISubmapManager manager) {
|
||||
addVariation(description, metadata, null, manager);
|
||||
}
|
||||
|
||||
public void addVariation(String description, int metadata, Block bb) {
|
||||
addVariation(description, metadata, null, bb, 0, ChiselAPIProps.MOD_ID);
|
||||
}
|
||||
public void addVariation(String description, int metadata, ISubmapManager manager) {
|
||||
addVariation(description, metadata, null, manager);
|
||||
}
|
||||
|
||||
public void addVariation(String description, int metadata, Block bb, int blockMeta) {
|
||||
addVariation(description, metadata, null, bb, blockMeta, ChiselAPIProps.MOD_ID);
|
||||
}
|
||||
public void addVariation(String description, int metadata, Block bb) {
|
||||
addVariation(description, metadata, null, bb, 0, ChiselAPIProps.MOD_ID);
|
||||
}
|
||||
|
||||
public void addVariation(String description, int metadata, Block bb, int blockMeta, Material material) {
|
||||
addVariation(description, metadata, null, bb, blockMeta, ChiselAPIProps.MOD_ID);
|
||||
}
|
||||
public void addVariation(String description, int metadata, Block bb, int blockMeta) {
|
||||
addVariation(description, metadata, null, bb, blockMeta, ChiselAPIProps.MOD_ID);
|
||||
}
|
||||
|
||||
public void addVariation(String description, int metadata, String texture) {
|
||||
addVariation(description, metadata, texture, (ISubmapManager) null);
|
||||
}
|
||||
|
||||
public void addVariation(String description, int metadata, String texture, ISubmapManager manager) {
|
||||
addVariation(description, metadata, texture, null, 0, ChiselAPIProps.MOD_ID, manager, metadata);
|
||||
}
|
||||
public void addVariation(String description, int metadata, Block bb, int blockMeta, Material material) {
|
||||
addVariation(description, metadata, null, bb, blockMeta, ChiselAPIProps.MOD_ID);
|
||||
}
|
||||
|
||||
public void addVariation(String description, int metadata, String texture) {
|
||||
addVariation(description, metadata, texture, (ISubmapManager) null);
|
||||
}
|
||||
|
||||
public void addVariation(String description, int metadata, String texture, ISubmapManager manager) {
|
||||
addVariation(description, metadata, texture, null, 0, ChiselAPIProps.MOD_ID, manager, metadata);
|
||||
}
|
||||
|
||||
public void addVariation(String description, int metadata, Block bb, String modid) {
|
||||
addVariation(description, metadata, null, bb, 0, modid);
|
||||
@@ -92,9 +92,8 @@ public class CarvableHelper {
|
||||
if (infoList.size() >= 16)
|
||||
return;
|
||||
|
||||
IVariationInfo info = FMLCommonHandler.instance().getSide().isClient()
|
||||
? getClientInfo(modid, texture, description, metadata, block, blockMeta, customManager, order)
|
||||
: getServerInfo(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);
|
||||
infoMap[metadata] = info;
|
||||
@@ -106,7 +105,7 @@ public class CarvableHelper {
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
ISubmapManager manager;
|
||||
if (customManager != null) {
|
||||
manager = customManager;
|
||||
@@ -117,7 +116,7 @@ public class CarvableHelper {
|
||||
}
|
||||
return new VariationInfoBase(var, description, manager);
|
||||
}
|
||||
|
||||
|
||||
private IVariationInfo getServerInfo(String modid, String texture, String description, int metadata, Block block, int blockMeta, ISubmapManager customManager, int order) {
|
||||
ICarvingVariation var = CarvingUtils.getDefaultVariationFor(theBlock, metadata, order);
|
||||
return new VariationInfoBase(var, description, null);
|
||||
@@ -141,7 +140,7 @@ public class CarvableHelper {
|
||||
IVariationInfo info = infoMap[metadata];
|
||||
if (info == null)
|
||||
return getMissingIcon();
|
||||
|
||||
|
||||
return info.getIcon(side, metadata);
|
||||
}
|
||||
|
||||
|
||||
@@ -119,6 +119,7 @@ public class CarvingUtils {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ICarvingVariation> getVariations() {
|
||||
return Lists.newArrayList(variations);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,6 @@ public interface IVariationInfo extends ISubmapManager {
|
||||
ICarvingVariation getVariation();
|
||||
|
||||
String getDescription();
|
||||
|
||||
|
||||
TextureType getType();
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
package com.cricketcraft.chisel.api.rendering;
|
||||
|
||||
|
||||
public class ClientUtils {
|
||||
|
||||
|
||||
public static int renderCTMId;
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user