mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-18 19:49:12 +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;
|
||||
Reference in new issue
Block a user