mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-11 15:57:31 +00:00
Fix enum formatting, remove some unused classes
This commit is contained in:
1 parent
2c9bbc233c
commit
05442f2d32
8 files changed
+9
-245
No files matched your search
@@ -29,7 +29,10 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
public class TileEntityAutoChisel extends TileEntity implements ISidedInventory {
|
||||
|
||||
public enum Upgrade {
|
||||
SPEED, AUTOMATION, STACK, REVERSION;
|
||||
SPEED,
|
||||
AUTOMATION,
|
||||
STACK,
|
||||
REVERSION;
|
||||
|
||||
public String getUnlocalizedName() {
|
||||
return ChiselItems.upgrade.getUnlocalizedName() + "_" + this.name().toLowerCase();
|
||||
|
||||
@@ -27,8 +27,9 @@ import com.google.common.collect.Multimap;
|
||||
public class ItemChisel extends Item implements IChiselItem {
|
||||
|
||||
public enum ChiselType {
|
||||
IRON(Configurations.ironChiselMaxDamage, Configurations.ironChiselAttackDamage), DIAMOND(Configurations.diamondChiselMaxDamage, Configurations.diamondChiselAttackDamage), OBSIDIAN(
|
||||
Configurations.obsidianChiselMaxDamage, Configurations.obsidianChiselAttackDamage);
|
||||
IRON(Configurations.ironChiselMaxDamage, Configurations.ironChiselAttackDamage),
|
||||
DIAMOND(Configurations.diamondChiselMaxDamage, Configurations.diamondChiselAttackDamage),
|
||||
OBSIDIAN(Configurations.obsidianChiselMaxDamage, Configurations.obsidianChiselAttackDamage);
|
||||
|
||||
final int maxDamage;
|
||||
final int attackDamage;
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
package com.cricketcraft.chisel.utils;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockTexturedOre extends Block {
|
||||
|
||||
int currentPass;
|
||||
Block base;
|
||||
IIcon icon;
|
||||
String iconFile;
|
||||
|
||||
public BlockTexturedOre(Material mat, Block base) {
|
||||
super(mat);
|
||||
|
||||
this.base = base;
|
||||
}
|
||||
|
||||
public BlockTexturedOre(Material mat, String iconFile) {
|
||||
super(mat);
|
||||
|
||||
this.iconFile = iconFile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return BlockTexturedOreRenderer.id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderBlockPass() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRenderInPass(int pass) {
|
||||
currentPass = pass;
|
||||
|
||||
return pass == 1 || pass == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
if (iconFile != null)
|
||||
icon = register.registerIcon(iconFile);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
package com.cricketcraft.chisel.utils;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.cricketcraft.ctmlib.Drawing;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
public class BlockTexturedOreRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
float bot = -0.001f, top = 1.0f - bot;
|
||||
static int id;
|
||||
|
||||
public BlockTexturedOreRenderer() {
|
||||
id = RenderingRegistry.getNextAvailableRenderId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block blck, int meta, int modelID, RenderBlocks renderer) {
|
||||
if (blck == null || !(blck instanceof BlockTexturedOre))
|
||||
return;
|
||||
|
||||
BlockTexturedOre block = (BlockTexturedOre) blck;
|
||||
|
||||
if (block.icon != null) {
|
||||
renderer.overrideBlockTexture = block.icon;
|
||||
renderer.renderBlockAsItem(Blocks.stone, meta, 1.0f);
|
||||
renderer.overrideBlockTexture = null;
|
||||
} else if (block.base != null) {
|
||||
renderer.renderBlockAsItem(block.base, meta, 1.0f);
|
||||
}
|
||||
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 771);
|
||||
renderer.setRenderBounds(bot, bot, bot, top, top, top);
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
Drawing.drawBlock(block, meta, renderer);
|
||||
GL11.glDisable(3042);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block blck, int modelId, RenderBlocks renderer) {
|
||||
if (blck == null || !(blck instanceof BlockTexturedOre))
|
||||
return false;
|
||||
BlockTexturedOre block = (BlockTexturedOre) blck;
|
||||
|
||||
if (block.currentPass == 0) {
|
||||
if (block.icon != null) {
|
||||
renderer.overrideBlockTexture = block.icon;
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
renderer.overrideBlockTexture = null;
|
||||
} else if (block.base != null) {
|
||||
renderer.renderBlockByRenderType(block.base, x, y, z);
|
||||
}
|
||||
} else {
|
||||
renderer.setRenderBounds(bot, bot, bot, top, top, top);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package com.cricketcraft.chisel.utils;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
|
||||
public class DummyContainer extends Container {
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
package com.cricketcraft.chisel.utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
|
||||
public abstract class GuiHandler implements Comparable<Object> {
|
||||
|
||||
static ArrayList<GuiHandler> items = new ArrayList<GuiHandler>();
|
||||
|
||||
int index;
|
||||
Object mod;
|
||||
String name;
|
||||
|
||||
public GuiHandler(String n) {
|
||||
items.add(this);
|
||||
name = n;
|
||||
}
|
||||
|
||||
public void open(EntityPlayer player, World world, int x, int y, int z) {
|
||||
player.openGui(mod, index, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Object a) {
|
||||
return name.compareTo(((GuiHandler) a).name);
|
||||
}
|
||||
|
||||
public static void register(Object mod) {
|
||||
Collections.sort(items);
|
||||
int index = 0;
|
||||
|
||||
for (GuiHandler h : items) {
|
||||
h.mod = mod;
|
||||
h.index = index++;
|
||||
}
|
||||
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(mod, new IGuiHandler() {
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
|
||||
if (id < 0 || id >= items.size()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return items.get(id).getServerGuiElement(id, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
|
||||
if (id < 0 || id >= items.size()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return items.get(id).getClientGuiElement(id, player, world, x, y, z);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public abstract Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z);
|
||||
|
||||
public abstract Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z);
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.cricketcraft.chisel.utils;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemMetaBlock extends ItemBlock {
|
||||
|
||||
public ItemMetaBlock(Block b) {
|
||||
super(b);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
if (itemstack == null) {
|
||||
return Block.getBlockFromItem(this).getUnlocalizedName();
|
||||
}
|
||||
|
||||
return Block.getBlockFromItem(this).getUnlocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int i) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user