Ready for a 2.0.0.3 with a little extra

This commit is contained in:
TheCricket committed 2014-11-09 12:01:44 -05:00
1 parent e96a1ced4c
commit 476d361cb6
15 files changed
+275 -22

No files matched your search

@@ -49,11 +49,12 @@ import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.GameRegistry.Type;
@Mod(modid = Chisel.MOD_ID, name = Chisel.MOD_NAME, version = "2.0.0.2", guiFactory = "info.jbcs.minecraft.chisel.client.gui.GuiFactory", dependencies = "after:ForgeMultipart;")
@Mod(modid = Chisel.MOD_ID, name = Chisel.MOD_NAME, version = Chisel.VERSION, guiFactory = "info.jbcs.minecraft.chisel.client.gui.GuiFactory", dependencies = "after:ForgeMultipart;")
public class Chisel
{
public static final String MOD_ID = "chisel";
public static final String MOD_NAME = "Chisel 2";
public static final String VERSION = "2.0.0.2";
public static boolean multipartLoaded = false;
@@ -202,7 +203,8 @@ public class Chisel
@SideOnly(Side.CLIENT)
private static void initModIntegration(){
ModIntegration.addMod(FMPIntegration.class);
//To be added back at a different time
//ModIntegration.addMod(FMPIntegration.class);
ModIntegration.init();
}
@@ -25,6 +25,21 @@ public class BlockAutoChisel extends BlockContainer
setHardness(1F);
}
@Override
public int getRenderType(){
return -1;
}
@Override
public boolean isOpaqueCube(){
return false;
}
@Override
public boolean renderAsNormalBlock(){
return false;
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int metadata, float x1, float y1, float z1){
TileEntity tile = world.getTileEntity(x, y, z);
@@ -2,7 +2,6 @@ package info.jbcs.minecraft.chisel.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import info.jbcs.minecraft.chisel.Chisel;
import info.jbcs.minecraft.chisel.api.ICarvable;
import info.jbcs.minecraft.chisel.carving.CarvableHelper;
import info.jbcs.minecraft.chisel.carving.CarvableVariation;
@@ -3,7 +3,6 @@ package info.jbcs.minecraft.chisel.block;
import info.jbcs.minecraft.chisel.api.ICarvable;
import info.jbcs.minecraft.chisel.carving.CarvableHelper;
import info.jbcs.minecraft.chisel.carving.CarvableVariation;
import info.jbcs.minecraft.chisel.Chisel;
import info.jbcs.minecraft.chisel.client.render.BlockMarbleStairsRenderer;
import java.util.List;
@@ -1,6 +1,5 @@
package info.jbcs.minecraft.chisel.block;
import info.jbcs.minecraft.chisel.Chisel;
import info.jbcs.minecraft.chisel.client.render.BlockRoadLineRenderer;
import info.jbcs.minecraft.chisel.init.ModTabs;
import net.minecraft.block.Block;
@@ -1,6 +1,5 @@
package info.jbcs.minecraft.chisel.block;
import info.jbcs.minecraft.chisel.Chisel;
import info.jbcs.minecraft.chisel.client.render.BlockSnakeStoneRenderer;
import java.util.List;
@@ -0,0 +1,147 @@
package info.jbcs.minecraft.chisel.client.model;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelAutoChisel extends ModelBase
{
//fields
ModelRenderer Shape1;
ModelRenderer Shape2;
ModelRenderer Shape3;
ModelRenderer Shape4;
ModelRenderer Shape5;
ModelRenderer Shape6;
ModelRenderer Shape7;
ModelRenderer Shape8;
ModelRenderer Shape9;
ModelRenderer Shape10;
ModelRenderer Shape11;
ModelRenderer Shape12;
public ModelAutoChisel()
{
textureWidth = 64;
textureHeight = 32;
Shape1 = new ModelRenderer(this, 0, 0);
Shape1.addBox(0F, 0F, 0F, 16, 1, 1);
Shape1.setRotationPoint(-8F, 23F, -8F);
Shape1.setTextureSize(64, 32);
Shape1.mirror = true;
setRotation(Shape1, 0F, 0F, 0F);
Shape2 = new ModelRenderer(this, 0, 0);
Shape2.addBox(0F, 0F, 0F, 1, 1, 15);
Shape2.setRotationPoint(-8F, 23F, -7F);
Shape2.setTextureSize(64, 32);
Shape2.mirror = true;
setRotation(Shape2, 0F, 0F, 0F);
Shape3 = new ModelRenderer(this, 0, 0);
Shape3.addBox(0F, 0F, 0F, 1, 1, 15);
Shape3.setRotationPoint(7F, 23F, -7F);
Shape3.setTextureSize(64, 32);
Shape3.mirror = true;
setRotation(Shape3, 0F, 0F, 0F);
Shape4 = new ModelRenderer(this, 0, 0);
Shape4.addBox(0F, 0F, 0F, 14, 1, 1);
Shape4.setRotationPoint(-7F, 23F, 7F);
Shape4.setTextureSize(64, 32);
Shape4.mirror = true;
setRotation(Shape4, 0F, 0F, 0F);
Shape5 = new ModelRenderer(this, 0, 0);
Shape5.addBox(0F, 0F, 0F, 1, 15, 1);
Shape5.setRotationPoint(-8F, 8F, -8F);
Shape5.setTextureSize(64, 32);
Shape5.mirror = true;
setRotation(Shape5, 0F, 0F, 0F);
Shape6 = new ModelRenderer(this, 0, 0);
Shape6.addBox(0F, 0F, 0F, 1, 15, 1);
Shape6.setRotationPoint(-8F, 8F, 7F);
Shape6.setTextureSize(64, 32);
Shape6.mirror = true;
setRotation(Shape6, 0F, 0F, 0F);
Shape7 = new ModelRenderer(this, 0, 0);
Shape7.addBox(0F, 0F, 0F, 1, 15, 1);
Shape7.setRotationPoint(7F, 8F, -8F);
Shape7.setTextureSize(64, 32);
Shape7.mirror = true;
setRotation(Shape7, 0F, 0F, 0F);
Shape8 = new ModelRenderer(this, 0, 0);
Shape8.addBox(0F, 0F, 0F, 1, 15, 1);
Shape8.setRotationPoint(7F, 8F, 7F);
Shape8.setTextureSize(64, 32);
Shape8.mirror = true;
setRotation(Shape8, 0F, 0F, 0F);
Shape9 = new ModelRenderer(this, 0, 0);
Shape9.addBox(0F, 0F, 0F, 14, 1, 1);
Shape9.setRotationPoint(-7F, 8F, 7F);
Shape9.setTextureSize(64, 32);
Shape9.mirror = true;
setRotation(Shape9, 0F, 0F, 0F);
Shape10 = new ModelRenderer(this, 0, 0);
Shape10.addBox(0F, 0F, 0F, 14, 1, 1);
Shape10.setRotationPoint(-7F, 8F, -8F);
Shape10.setTextureSize(64, 32);
Shape10.mirror = true;
setRotation(Shape10, 0F, 0F, 0F);
Shape11 = new ModelRenderer(this, 0, 0);
Shape11.addBox(0F, 0F, 0F, 1, 1, 14);
Shape11.setRotationPoint(7F, 8F, -7F);
Shape11.setTextureSize(64, 32);
Shape11.mirror = true;
setRotation(Shape11, 0F, 0F, 0F);
Shape12 = new ModelRenderer(this, 0, 0);
Shape12.addBox(0F, 0F, 0F, 1, 1, 14);
Shape12.setRotationPoint(-8F, 8F, -7F);
Shape12.setTextureSize(64, 32);
Shape12.mirror = true;
setRotation(Shape12, 0F, 0F, 0F);
}
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5);
Shape1.render(f5);
Shape2.render(f5);
Shape3.render(f5);
Shape4.render(f5);
Shape5.render(f5);
Shape6.render(f5);
Shape7.render(f5);
Shape8.render(f5);
Shape9.render(f5);
Shape10.render(f5);
Shape11.render(f5);
Shape12.render(f5);
}
public void renderAll(){
Shape1.render(0.0625F);
Shape2.render(0.0625F);
Shape3.render(0.0625F);
Shape4.render(0.0625F);
Shape5.render(0.0625F);
Shape6.render(0.0625F);
Shape7.render(0.0625F);
Shape8.render(0.0625F);
Shape9.render(0.0625F);
Shape10.render(0.0625F);
Shape11.render(0.0625F);
Shape12.render(0.0625F);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
{
super.setRotationAngles(f, f1, f2, f3, f4, f5, null);
}
}
@@ -4,6 +4,8 @@ import info.jbcs.minecraft.chisel.api.ICarvable;
import info.jbcs.minecraft.chisel.carving.CarvableHelper;
import info.jbcs.minecraft.chisel.carving.CarvableVariation;
import info.jbcs.minecraft.chisel.Chisel;
import info.jbcs.minecraft.chisel.client.render.RenderBlocksCTM;
import info.jbcs.minecraft.chisel.client.render.RenderBlocksColumn;
import info.jbcs.minecraft.chisel.utils.Drawing;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
@@ -16,7 +18,7 @@ import cpw.mods.fml.client.registry.RenderingRegistry;
public class BlockAdvancedMarbleRenderer implements ISimpleBlockRenderingHandler
{
RenderBlocksCTM rendererCTM = new RenderBlocksCTM();
public RenderBlocksCTM rendererCTM = new RenderBlocksCTM();
RenderBlocksColumn rendererColumn = new RenderBlocksColumn();
public BlockAdvancedMarbleRenderer()
@@ -1,6 +1,7 @@
package info.jbcs.minecraft.chisel.client.render;
import info.jbcs.minecraft.chisel.Chisel;
import info.jbcs.minecraft.chisel.client.render.RenderBlocksEldritch;
import info.jbcs.minecraft.chisel.utils.Drawing;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
@@ -0,0 +1,63 @@
package info.jbcs.minecraft.chisel.client.render.item;
import cpw.mods.fml.client.FMLClientHandler;
import info.jbcs.minecraft.chisel.client.model.ModelAutoChisel;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
public class ItemAutoChiselRenderer implements IItemRenderer{
private final ModelAutoChisel model = new ModelAutoChisel();
private final ResourceLocation texture = new ResourceLocation("chisel:textures/blocks/autoChisel.png");
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
return type != ItemRenderType.FIRST_PERSON_MAP;
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
return true;
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
FMLClientHandler.instance().getClient().renderEngine.bindTexture(texture);
switch (type){
case ENTITY:
renderBlock(0.0F, 1.0F, 0.0F);
break;
case EQUIPPED:
renderBlock(0.5F, 1.5F, 0.5F);
break;
case EQUIPPED_FIRST_PERSON:
renderBlock(0.5F, 1.0F, 0.5F);
break;
case INVENTORY:
renderInventory(0.0F, 0.625F, 0.0F);
break;
default:
break;
}
}
private void renderBlock(float x, float y, float z){
GL11.glPushMatrix();
GL11.glTranslatef(x, y, z);
GL11.glScaled(-1, -1, 1);
model.renderAll();
GL11.glPopMatrix();
}
private void renderInventory(float x, float y, float z){
GL11.glPushMatrix();
GL11.glTranslatef(x, y, z);
GL11.glRotatef(180F, 1F, 0, 0);
GL11.glRotatef(-90F, 0, 1F, 0);
GL11.glScalef(0.8F, 0.8F, 0.8F);
model.renderAll();
GL11.glPopMatrix();
}
}
@@ -1,4 +1,4 @@
package info.jbcs.minecraft.chisel.client.render;
package info.jbcs.minecraft.chisel.client.render.item;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderBlocks;
@@ -0,0 +1,28 @@
package info.jbcs.minecraft.chisel.client.render.tile;
import info.jbcs.minecraft.chisel.client.model.ModelAutoChisel;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
public class RenderAutoChisel extends TileEntitySpecialRenderer {
private final ModelAutoChisel model;
private final ResourceLocation texture = new ResourceLocation("chisel:textures/blocks/autoChisel.png");
public RenderAutoChisel(){
model = new ModelAutoChisel();
}
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float scale) {
bindTexture(texture);
GL11.glPushMatrix();
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
GL11.glScalef(0.89F, 1.0F, 0.89F);
this.model.renderAll();
GL11.glPopMatrix();
}
}
@@ -86,7 +86,7 @@ public class ModBlocks {
public static void load()
{
if(Configurations.featureEnabled("autoChisel")){
autoChisel = new BlockAutoChisel().setBlockTextureName("Chisel:autoChisel").setCreativeTab(ModTabs.tabChisel);
autoChisel = new BlockAutoChisel().setBlockTextureName("Chisel:autoChiselOld").setCreativeTab(ModTabs.tabChisel);
GameRegistry.registerBlock(autoChisel, autoChisel.getUnlocalizedName());
Chisel.proxy.registerTileEntities();
}
@@ -1,22 +1,17 @@
package info.jbcs.minecraft.chisel.proxy;
import info.jbcs.minecraft.chisel.Chisel;
import cpw.mods.fml.client.registry.ClientRegistry;
import info.jbcs.minecraft.chisel.block.tileentity.TileEntityAutoChisel;
import info.jbcs.minecraft.chisel.client.render.*;
import info.jbcs.minecraft.chisel.client.render.item.ItemAutoChiselRenderer;
import info.jbcs.minecraft.chisel.client.render.item.ItemChiselRenderer;
import info.jbcs.minecraft.chisel.client.render.tile.RenderAutoChisel;
import info.jbcs.minecraft.chisel.entity.EntityBallOMoss;
import info.jbcs.minecraft.chisel.entity.EntityCloudInABottle;
import info.jbcs.minecraft.chisel.client.render.BlockAdvancedMarbleRenderer;
import info.jbcs.minecraft.chisel.client.render.BlockCarpetRenderer;
import info.jbcs.minecraft.chisel.client.render.BlockEldritchRenderer;
import info.jbcs.minecraft.chisel.client.render.BlockMarblePaneRenderer;
import info.jbcs.minecraft.chisel.client.render.BlockMarblePillarRenderer;
import info.jbcs.minecraft.chisel.client.render.BlockMarbleStairsRenderer;
import info.jbcs.minecraft.chisel.client.render.BlockNoCTMRenderer;
import info.jbcs.minecraft.chisel.client.render.BlockRoadLineRenderer;
import info.jbcs.minecraft.chisel.client.render.BlockSnakeStoneRenderer;
import info.jbcs.minecraft.chisel.client.render.BlockSpikesRenderer;
import info.jbcs.minecraft.chisel.client.render.BlockTexturedOreRenderer;
import info.jbcs.minecraft.chisel.client.render.ItemChiselRenderer;
import info.jbcs.minecraft.chisel.init.ModBlocks;
import info.jbcs.minecraft.chisel.init.ModItems;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.item.Item;
import net.minecraftforge.client.MinecraftForgeClient;
import cpw.mods.fml.client.registry.RenderingRegistry;
@@ -45,6 +40,10 @@ public class ClientProxy extends CommonProxy
RenderingRegistry.registerBlockHandler(new BlockTexturedOreRenderer());
//ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAutoChisel.class, new RenderAutoChisel());
//MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.autoChisel), new ItemAutoChiselRenderer());
RenderingRegistry.registerEntityRenderingHandler(EntityCloudInABottle.class, new RenderSnowball(ModItems.itemCloudInABottle));
RenderingRegistry.registerEntityRenderingHandler(EntityBallOMoss.class, new RenderSnowball(ModItems.itemBallOMoss));