mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-11 15:57:31 +00:00
Merge branch 'revert' into dev
This commit is contained in:
commit
8bf352ee82
33 files changed
+260
-7
No files matched your search
@@ -0,0 +1,38 @@
|
||||
package com.cricketcraft.chisel.block;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import com.cricketcraft.chisel.Chisel;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockCarvableLayered extends BlockCarvable {
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon baseTexture;
|
||||
private String baseTexLocation;
|
||||
|
||||
public BlockCarvableLayered(Material mat, String baseTexLocation) {
|
||||
super(mat);
|
||||
this.baseTexLocation = baseTexLocation;
|
||||
}
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
super.registerBlockIcons(register);
|
||||
baseTexture = register.registerIcon(Chisel.MOD_ID + ":" + baseTexLocation);
|
||||
}
|
||||
public IIcon getBaseTex() {
|
||||
return baseTexture;
|
||||
}
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return Chisel.renderLayeredId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.cricketcraft.chisel.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockTorch;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.cricketcraft.chisel.Chisel;
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.carving.CarvableHelper;
|
||||
import com.cricketcraft.chisel.carving.CarvableVariation;
|
||||
import com.cricketcraft.chisel.init.ChiselTabs;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockCarvableTorch extends BlockTorch implements ICarvable
|
||||
{
|
||||
public CarvableHelper carverHelper;
|
||||
private String texLocation;
|
||||
protected boolean emitsParticles = true;
|
||||
|
||||
public BlockCarvableTorch()
|
||||
{
|
||||
super();
|
||||
carverHelper = new CarvableHelper();
|
||||
setCreativeTab(ChiselTabs.tabOtherChiselBlocks);
|
||||
setLightLevel(0.9375F);
|
||||
setBlockName("torch");
|
||||
}
|
||||
@Override
|
||||
public CarvableVariation getVariation(int metadata) {
|
||||
return carverHelper.getVariation(metadata);
|
||||
}
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister icon){
|
||||
this.blockIcon = icon.registerIcon(Chisel.MOD_ID + ":torch/"+ texLocation);
|
||||
}
|
||||
public void setInformation(String textureLocation){
|
||||
this.texLocation = textureLocation;
|
||||
}
|
||||
public BlockCarvableTorch disableParticles()
|
||||
{
|
||||
this.emitsParticles = false;
|
||||
return this;
|
||||
}
|
||||
@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_)
|
||||
{
|
||||
if(emitsParticles)
|
||||
{
|
||||
int l = p_149734_1_.getBlockMetadata(p_149734_2_, p_149734_3_, p_149734_4_);
|
||||
double d0 = (double)((float)p_149734_2_ + 0.5F);
|
||||
double d1 = (double)((float)p_149734_3_ + 0.7F);
|
||||
double d2 = (double)((float)p_149734_4_ + 0.5F);
|
||||
double d3 = 0.2199999988079071D;
|
||||
double d4 = 0.27000001072883606D;
|
||||
|
||||
if (l == 1)
|
||||
{
|
||||
p_149734_1_.spawnParticle("smoke", d0 - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
|
||||
p_149734_1_.spawnParticle("flame", d0 - d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if (l == 2)
|
||||
{
|
||||
p_149734_1_.spawnParticle("smoke", d0 + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
|
||||
p_149734_1_.spawnParticle("flame", d0 + d4, d1 + d3, d2, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if (l == 3)
|
||||
{
|
||||
p_149734_1_.spawnParticle("smoke", d0, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D);
|
||||
p_149734_1_.spawnParticle("flame", d0, d1 + d3, d2 - d4, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if (l == 4)
|
||||
{
|
||||
p_149734_1_.spawnParticle("smoke", d0, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D);
|
||||
p_149734_1_.spawnParticle("flame", d0, d1 + d3, d2 + d4, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else
|
||||
{
|
||||
p_149734_1_.spawnParticle("smoke", d0, d1, d2, 0.0D, 0.0D, 0.0D);
|
||||
p_149734_1_.spawnParticle("flame", d0, d1, d2, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.cricketcraft.chisel.client.render;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.cricketcraft.chisel.Chisel;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableLayered;
|
||||
import com.cricketcraft.chisel.utils.Drawing;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
public class BlockLayeredRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
public BlockLayeredRenderer() {
|
||||
Chisel.renderLayeredId = RenderingRegistry.getNextAvailableRenderId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
Drawing.drawBlock(block, ((BlockCarvableLayered)block).getBaseTex(), renderer);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
Drawing.drawBlock(block, metadata, renderer);
|
||||
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
Drawing.renderAllFaces(renderer, block, x, y, z, ((BlockCarvableLayered) block).getBaseTex());
|
||||
Tessellator.instance.setBrightness(0xFFFFFF);
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return Chisel.renderLayeredId;
|
||||
}
|
||||
}
|
||||
@@ -5,12 +5,14 @@ import net.minecraft.block.Block;
|
||||
import com.cricketcraft.chisel.Chisel;
|
||||
import com.cricketcraft.chisel.block.BlockCarvable;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableGlass;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableLayered;
|
||||
import com.cricketcraft.chisel.block.BlockCarvablePane;
|
||||
import com.cricketcraft.chisel.block.BlockCarvablePowered;
|
||||
import com.cricketcraft.chisel.block.BlockCarvablePumpkin;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableSand;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableSlab;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableStairs;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableTorch;
|
||||
import com.cricketcraft.chisel.block.BlockCloud;
|
||||
import com.cricketcraft.chisel.block.BlockConcrete;
|
||||
import com.cricketcraft.chisel.block.BlockGrimstone;
|
||||
@@ -104,16 +106,15 @@ public final class ChiselBlocks {
|
||||
public static final BlockCarvable technical = null;
|
||||
public static final BlockCarvableGlass technical2 = null;
|
||||
public static final BlockCarvable futura = null;
|
||||
public static final BlockCarvable bone = null;
|
||||
public static final BlockCarvable scorching = null;
|
||||
public static final BlockCarvable brickCustom = null;
|
||||
public static final BlockCarvable sign = null;
|
||||
public static final BlockCarvableLayered sign = null;
|
||||
public static final BlockCarvable arcane = null;
|
||||
public static final BlockCarvable thaumium = null;
|
||||
public static final BlockCarvable tallow = null;
|
||||
|
||||
public static final BlockCarvable bloodRune = null;
|
||||
public static final BlockCarvableSand colored_sand = null;
|
||||
public static BlockCarvableTorch[] torch = new BlockCarvableTorch[16];
|
||||
|
||||
// Arrays can't be final because of how @ObjectHolder works
|
||||
public static BlockCarvable[] planks = new BlockCarvable[6];
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
package com.cricketcraft.chisel.init;
|
||||
|
||||
import static com.cricketcraft.chisel.init.ChiselBlocks.carpet_block;
|
||||
import static com.cricketcraft.chisel.init.ChiselBlocks.jackolantern;
|
||||
import static com.cricketcraft.chisel.init.ChiselBlocks.planks;
|
||||
import static com.cricketcraft.chisel.init.ChiselBlocks.present;
|
||||
import static com.cricketcraft.chisel.init.ChiselBlocks.pumpkin;
|
||||
import static com.cricketcraft.chisel.init.ChiselBlocks.stainedGlass;
|
||||
import static com.cricketcraft.chisel.init.ChiselBlocks.stainedGlassPane;
|
||||
import static com.cricketcraft.chisel.init.ChiselBlocks.torch;
|
||||
import static com.cricketcraft.chisel.utils.General.sGNames;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -19,12 +28,14 @@ import com.cricketcraft.chisel.block.BlockBeaconBase;
|
||||
import com.cricketcraft.chisel.block.BlockCarvable;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableGlass;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableGlow;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableLayered;
|
||||
import com.cricketcraft.chisel.block.BlockCarvablePane;
|
||||
import com.cricketcraft.chisel.block.BlockCarvablePowered;
|
||||
import com.cricketcraft.chisel.block.BlockCarvablePumpkin;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableSand;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableSlab;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableStairs;
|
||||
import com.cricketcraft.chisel.block.BlockCarvableTorch;
|
||||
import com.cricketcraft.chisel.block.BlockCloud;
|
||||
import com.cricketcraft.chisel.block.BlockConcrete;
|
||||
import com.cricketcraft.chisel.block.BlockEldritch;
|
||||
@@ -70,9 +81,6 @@ import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import static com.cricketcraft.chisel.init.ChiselBlocks.*;
|
||||
import static com.cricketcraft.chisel.utils.General.*;
|
||||
|
||||
public enum Features {
|
||||
|
||||
AE_CERTUS_QUARTZ("appliedenergistics2") {
|
||||
@@ -170,6 +178,7 @@ public enum Features {
|
||||
|
||||
AUTO_CHISEL {
|
||||
|
||||
@Override
|
||||
void addBlocks() {
|
||||
Block autoChisel = new BlockAutoChisel().setBlockTextureName(Chisel.MOD_ID + ":autoChisel/autoChisel").setCreativeTab(ChiselTabs.tabChisel).setBlockName("autoChisel");
|
||||
GameRegistry.registerBlock(autoChisel, "autoChisel");
|
||||
@@ -762,6 +771,7 @@ public enum Features {
|
||||
|
||||
GLASS_STAINED {
|
||||
|
||||
@Override
|
||||
void addBlocks() {
|
||||
for (int i = 0; i < 16; i++) {
|
||||
final String blockName = "stained_glass_" + sGNames[i].replaceAll(" ", "").toLowerCase();
|
||||
@@ -1807,6 +1817,7 @@ public enum Features {
|
||||
|
||||
RC_QUARRIED_BLOCK(RAILCRAFT.getRequiredMod(), RAILCRAFT) {
|
||||
|
||||
@Override
|
||||
void addBlocks() {
|
||||
Carving.chisel.addVariation("RCQuarriedBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.quarried"), 0, 0);
|
||||
Carving.chisel.addVariation("RCQuarriedBlock", GameRegistry.findBlock("Railcraft", "tile.railcraft.brick.quarried"), 1, 1);
|
||||
@@ -2112,6 +2123,7 @@ public enum Features {
|
||||
|
||||
TEMPLE_BLOCK_MOSSY {
|
||||
|
||||
@Override
|
||||
void addBlocks() {
|
||||
BlockCarvable mossy_templeblock = (BlockCarvable) new BlockEldritch().setHardness(2.0F).setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setResistance(10F)
|
||||
.setStepSound(Chisel.soundTempleFootstep);
|
||||
@@ -2259,6 +2271,7 @@ public enum Features {
|
||||
|
||||
VOIDSTONE_PILLARS {
|
||||
|
||||
@Override
|
||||
void addBlocks() {
|
||||
BlockVoidstonePillar voidstonePillar = (BlockVoidstonePillar) new BlockVoidstonePillar().setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setStepSound(Block.soundTypeStone);
|
||||
voidstonePillar.carvableHelper.addVariation(StatCollector.translateToLocal("tile.voidstonePillar.0.desc"), 0, "voidstone/pillar-side");
|
||||
@@ -2364,7 +2377,52 @@ public enum Features {
|
||||
boolean needsMetaRecipes() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
WARNING_SIGN {
|
||||
@Override
|
||||
void addBlocks() {
|
||||
BlockCarvableLayered sign = (BlockCarvableLayered) new BlockCarvableLayered(Material.iron, "warning/base").setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10.0F);
|
||||
sign.carverHelper.addVariation(StatCollector.translateToLocal("tile.warningSign.0.desc"), 0, "warning/rad");
|
||||
sign.carverHelper.addVariation(StatCollector.translateToLocal("tile.warningSign.1.desc"), 1, "warning/bio");
|
||||
sign.carverHelper.addVariation(StatCollector.translateToLocal("tile.warningSign.2.desc"), 2, "warning/fire");
|
||||
sign.carverHelper.addVariation(StatCollector.translateToLocal("tile.warningSign.3.desc"), 3, "warning/explosion");
|
||||
sign.carverHelper.addVariation(StatCollector.translateToLocal("tile.warningSign.4.desc"), 4, "warning/death");
|
||||
sign.carverHelper.addVariation(StatCollector.translateToLocal("tile.warningSign.5.desc"), 5, "warning/falling");
|
||||
sign.carverHelper.addVariation(StatCollector.translateToLocal("tile.warningSign.6.desc"), 6, "warning/fall");
|
||||
sign.carverHelper.addVariation(StatCollector.translateToLocal("tile.warningSign.7.desc"), 7, "warning/voltage");
|
||||
sign.carverHelper.addVariation(StatCollector.translateToLocal("tile.warningSign.8.desc"), 8, "warning/generic");
|
||||
sign.carverHelper.addVariation(StatCollector.translateToLocal("tile.warningSign.9.desc"), 9, "warning/acid");
|
||||
sign.carverHelper.addVariation(StatCollector.translateToLocal("tile.warningSign.10.desc"), 10, "warning/underconstruction");
|
||||
sign.carverHelper.addVariation(StatCollector.translateToLocal("tile.warningSign.11.desc"), 11, "warning/sound");
|
||||
sign.carverHelper.addVariation(StatCollector.translateToLocal("tile.warningSign.12.desc"), 12, "warning/noentry");
|
||||
sign.carverHelper.addVariation(StatCollector.translateToLocal("tile.warningSign.13.desc"), 13, "warning/cryogenic");
|
||||
sign.carverHelper.register(sign, "warningSign");
|
||||
Carving.chisel.registerOre("warningSign", "warningSign");
|
||||
}
|
||||
@Override
|
||||
void addRecipes() {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.sign, 4, 0), new Object[]{"xxx", "xyx", "xxx", 'x', "stone", 'y', Items.sign}));
|
||||
}
|
||||
},
|
||||
|
||||
TORCH {
|
||||
@Override
|
||||
void addBlocks() {
|
||||
Carving.chisel.addVariation("torch", Blocks.torch, 0, 0);
|
||||
for(int type = 0; type < 10; type++){
|
||||
if(type == 8 || type == 9)
|
||||
torch[type] = (BlockCarvableTorch) new BlockCarvableTorch().disableParticles();
|
||||
else
|
||||
torch[type] = (BlockCarvableTorch) new BlockCarvableTorch();
|
||||
|
||||
torch[type].setInformation("torch" + (type + 1));
|
||||
GameRegistry.registerBlock(torch[type], "torch" + (type + 1));
|
||||
Carving.chisel.addVariation("torch", torch[type], 0, (type + 1));
|
||||
}
|
||||
Carving.chisel.registerOre("torch", "torch");
|
||||
}
|
||||
},
|
||||
|
||||
;
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.cricketcraft.chisel.client.render.BlockAdvancedMarbleRenderer;
|
||||
import com.cricketcraft.chisel.client.render.BlockCarpetRenderer;
|
||||
import com.cricketcraft.chisel.client.render.BlockEldritchRenderer;
|
||||
import com.cricketcraft.chisel.client.render.BlockGlowRenderer;
|
||||
import com.cricketcraft.chisel.client.render.BlockLayeredRenderer;
|
||||
import com.cricketcraft.chisel.client.render.BlockMarblePaneRenderer;
|
||||
import com.cricketcraft.chisel.client.render.BlockMarblePillarRenderer;
|
||||
import com.cricketcraft.chisel.client.render.BlockMarbleStairsRenderer;
|
||||
@@ -53,6 +54,7 @@ public class ClientProxy extends CommonProxy {
|
||||
RenderingRegistry.registerBlockHandler(new BlockAdvancedMarbleRenderer());
|
||||
RenderingRegistry.registerBlockHandler(new BlockCarpetRenderer());
|
||||
RenderingRegistry.registerBlockHandler(new BlockGlowRenderer());
|
||||
RenderingRegistry.registerBlockHandler(new BlockLayeredRenderer());
|
||||
|
||||
RenderingRegistry.registerBlockHandler(new BlockTexturedOreRenderer());
|
||||
|
||||
|
||||
Reference in new issue
Block a user