mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-17 11:15:07 +00:00
Rework the warning sign background texture.
Also prevent lightbulbs smoking (it was bad for their health)
This commit is contained in:
1 parent
940b98bed8
commit
a0acbef0d5
23 files changed
+191
-39
No files matched your search
@@ -1,6 +1,20 @@
|
||||
package com.cricketcraft.chisel;
|
||||
|
||||
import com.cricketcraft.chisel.api.IChiselItem;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import com.cricketcraft.chisel.block.BlockCarvable;
|
||||
import com.cricketcraft.chisel.block.tileentity.TileEntityAutoChisel;
|
||||
import com.cricketcraft.chisel.block.tileentity.TileEntityPresent;
|
||||
@@ -30,8 +44,12 @@ import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.*;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.event.FMLMissingMappingsEvent;
|
||||
import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
@@ -39,20 +57,6 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.Type;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@Mod(modid = Chisel.MOD_ID, name = Chisel.MOD_NAME, version = Chisel.VERSION, guiFactory = "com.cricketcraft.chisel.client.gui.GuiFactory", dependencies = "after:ForgeMultipart;after:Thaumcraft;after:appliedenergistics2;after:Railcraft")
|
||||
public class Chisel {
|
||||
@@ -70,7 +74,8 @@ public class Chisel {
|
||||
public static int renderCarpetId;
|
||||
public static int renderAutoChiselId;
|
||||
public static int renderGlowId;
|
||||
|
||||
public static int renderLayeredId;
|
||||
|
||||
public static final Logger logger = LogManager.getLogger(MOD_ID);
|
||||
|
||||
@Instance(MOD_ID)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -1,33 +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;
|
||||
public CarvableHelper carverHelper;
|
||||
private String texLocation;
|
||||
protected boolean emitsParticles = true;
|
||||
|
||||
public BlockCarvableTorch()
|
||||
{
|
||||
super();
|
||||
|
||||
carverHelper = new CarvableHelper();
|
||||
}
|
||||
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 registerBlockIcons(IIconRegister icon){
|
||||
this.blockIcon = icon.registerIcon(Chisel.MOD_ID + ":torch/"+ texLocation);
|
||||
}
|
||||
public void setInformation(String textureLocation){
|
||||
this.texLocation = 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,49 @@
|
||||
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());
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return Chisel.renderLayeredId;
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ 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;
|
||||
@@ -105,10 +106,8 @@ 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 bloodRune = null;
|
||||
public static final BlockCarvableSand colored_sand = null;
|
||||
|
||||
@@ -28,6 +28,7 @@ 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;
|
||||
@@ -2343,7 +2344,7 @@ public enum Features {
|
||||
WARNING_SIGN {
|
||||
@Override
|
||||
void addBlocks() {
|
||||
BlockCarvable sign = (BlockCarvable) new BlockCarvable(Material.iron).setCreativeTab(ChiselTabs.tabMetalChiselBlocks).setHardness(2.0F).setResistance(10.0F);
|
||||
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");
|
||||
@@ -2371,11 +2372,15 @@ public enum Features {
|
||||
@Override
|
||||
void addBlocks() {
|
||||
Carving.chisel.addVariation("torch", Blocks.torch, 0, 0);
|
||||
for(int metadata = 0; metadata < 10; metadata++){
|
||||
torch[metadata] = (BlockCarvableTorch) new BlockCarvableTorch().setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setLightLevel(0.9375F).setBlockName("torch");
|
||||
torch[metadata].setInformation("torch" + (metadata + 1));
|
||||
GameRegistry.registerBlock(torch[metadata], "torch" + (metadata + 1));
|
||||
Carving.chisel.addVariation("torch", torch[metadata], 0, (metadata + 1));
|
||||
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