mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-12 16:27:45 +00:00
Merge branch 'dev' of https://github.com/TheCricket/Chisel-2.git into dev
This commit is contained in:
commit
cc984eb615
6 files changed
+41
-42
No files matched your search
@@ -76,6 +76,7 @@ public class Chisel {
|
||||
public static int renderAutoChiselId;
|
||||
public static int renderGlowId;
|
||||
public static int renderLayeredId;
|
||||
public static int roadLineId;
|
||||
|
||||
public static final Logger logger = LogManager.getLogger(MOD_ID);
|
||||
|
||||
|
||||
@@ -1,26 +1,29 @@
|
||||
package com.cricketcraft.chisel.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.cricketcraft.chisel.Chisel;
|
||||
import com.cricketcraft.chisel.client.render.BlockRoadLineRenderer;
|
||||
import com.cricketcraft.chisel.config.Configurations;
|
||||
|
||||
public class BlockRoadLine extends Block {
|
||||
public class BlockRoadLine extends BlockCarvable {
|
||||
|
||||
public IIcon aloneIcon;
|
||||
public IIcon halfLineIcon;
|
||||
public IIcon fullLineIcon;
|
||||
private String type;
|
||||
public IIcon aloneIcon[] = new IIcon[4];
|
||||
public IIcon halfLineIcon[] = new IIcon[4];
|
||||
public IIcon fullLineIcon[] = new IIcon[4];
|
||||
|
||||
public BlockRoadLine(String type) {
|
||||
public BlockRoadLine() {
|
||||
super(Material.circuits);
|
||||
this.type = type;
|
||||
|
||||
if (Configurations.useRoadLineTool) {
|
||||
this.setHarvestLevel(Configurations.getRoadLineTool,Configurations.roadLineToolLevel);
|
||||
@@ -28,7 +31,6 @@ public class BlockRoadLine extends Block {
|
||||
this.setBlockBounds(0.0f, 0.0f, 0.0f, 1.0f, 0.00390625f, 1.0f);
|
||||
// this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) {
|
||||
return null;
|
||||
@@ -46,7 +48,7 @@ public class BlockRoadLine extends Block {
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return BlockRoadLineRenderer.id;
|
||||
return Chisel.roadLineId;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -69,9 +71,13 @@ public class BlockRoadLine extends Block {
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
blockIcon = aloneIcon = reg.registerIcon("Chisel:line-marking/" + type + "-center");
|
||||
halfLineIcon = reg.registerIcon("Chisel:line-marking/" + type + "-side");
|
||||
fullLineIcon = reg.registerIcon("Chisel:line-marking/" + type + "-long");
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
String[] texNames = {"white", "yellow", "double-white", "double-yellow"};
|
||||
aloneIcon[i] = reg.registerIcon("Chisel:line-marking/" + texNames[i] + "-center");
|
||||
halfLineIcon[i] = reg.registerIcon("Chisel:line-marking/" + texNames[i] + "-side");
|
||||
fullLineIcon[i] = reg.registerIcon("Chisel:line-marking/" + texNames[i] + "-long");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import com.cricketcraft.chisel.Chisel;
|
||||
import com.cricketcraft.chisel.block.BlockRoadLine;
|
||||
import com.cricketcraft.chisel.utils.Drawing;
|
||||
|
||||
@@ -15,10 +16,8 @@ import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
||||
public class BlockRoadLineRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
public static int id;
|
||||
|
||||
public BlockRoadLineRenderer() {
|
||||
id = RenderingRegistry.getNextAvailableRenderId();
|
||||
Chisel.roadLineId = RenderingRegistry.getNextAvailableRenderId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -72,18 +71,18 @@ public class BlockRoadLineRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
if (N && S) {
|
||||
renderer.uvRotateTop = 0;
|
||||
renderer.overrideBlockTexture = block.fullLineIcon;
|
||||
renderer.overrideBlockTexture = block.fullLineIcon[meta];
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
|
||||
} else {
|
||||
if (N) {
|
||||
renderer.uvRotateTop = 0;
|
||||
renderer.overrideBlockTexture = block.halfLineIcon;
|
||||
renderer.overrideBlockTexture = block.halfLineIcon[meta];
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
if (S) {
|
||||
renderer.uvRotateTop = 3;
|
||||
renderer.overrideBlockTexture = block.halfLineIcon;
|
||||
renderer.overrideBlockTexture = block.halfLineIcon[meta];
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
@@ -91,17 +90,17 @@ public class BlockRoadLineRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
if (E && W) {
|
||||
renderer.uvRotateTop = 1;
|
||||
renderer.overrideBlockTexture = block.fullLineIcon;
|
||||
renderer.overrideBlockTexture = block.fullLineIcon[meta];
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
} else {
|
||||
if (E) {
|
||||
renderer.uvRotateTop = 1;
|
||||
renderer.overrideBlockTexture = block.halfLineIcon;
|
||||
renderer.overrideBlockTexture = block.halfLineIcon[meta];
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
if (W) {
|
||||
renderer.uvRotateTop = 2;
|
||||
renderer.overrideBlockTexture = block.halfLineIcon;
|
||||
renderer.overrideBlockTexture = block.halfLineIcon[meta];
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -118,6 +117,6 @@ public class BlockRoadLineRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return id;
|
||||
return Chisel.roadLineId;
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@ public final class ChiselBlocks {
|
||||
public static final BlockCarvable sandstone = null;
|
||||
public static final BlockCarvable sandstone_scribbles = null;
|
||||
public static final BlockConcrete concrete = null;
|
||||
public static BlockRoadLine road_line = null;
|
||||
public static final BlockRoadLine road_line = null;
|
||||
public static final BlockCarvable iron_block = null;
|
||||
public static final BlockCarvable gold_block = null;
|
||||
public static final BlockCarvable diamond_block = null;
|
||||
|
||||
@@ -186,8 +186,8 @@ public enum Features {
|
||||
|
||||
@Override
|
||||
void addRecipes() {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.autoChisel, 1), new Object[] { "XXX", "XYX", "XXX", Character.valueOf('X'), "plankWood", Character.valueOf('Y'),
|
||||
ChiselItems.chisel }));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ChiselBlocks.autoChisel, 1), new Object[] { "XXX", " Y ", "YYY", Character.valueOf('X'), Blocks.stone_slab, Character.valueOf('Y'),
|
||||
"ingotIron" }));
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1875,21 +1875,13 @@ public enum Features {
|
||||
|
||||
@Override
|
||||
void addBlocks() {
|
||||
BlockRoadLine road_line = (BlockRoadLine) new BlockRoadLine("white").setStepSound(Block.soundTypeStone).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.01F)
|
||||
BlockRoadLine road_line = (BlockRoadLine) new BlockRoadLine().setStepSound(Block.soundTypeStone).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.01F)
|
||||
.setBlockName("roadLine");
|
||||
road_line.carverHelper.addVariation(StatCollector.translateToLocal("tile.roadLine.0.desc"), 0, "line-marking/white-center");
|
||||
road_line.carverHelper.addVariation(StatCollector.translateToLocal("tile.roadLine.1.desc"), 1, "line-marking/double-white-center");
|
||||
road_line.carverHelper.addVariation(StatCollector.translateToLocal("tile.roadLine.2.desc"), 2, "line-marking/yellow-center");
|
||||
road_line.carverHelper.addVariation(StatCollector.translateToLocal("tile.roadine.3.desc"), 3, "line-marking/double-yellow-center");
|
||||
GameRegistry.registerBlock(road_line, ItemCarvable.class, "road_line");
|
||||
BlockRoadLine road_line1 = (BlockRoadLine) new BlockRoadLine("yellow").setStepSound(Block.soundTypeStone).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.01F)
|
||||
.setBlockName("roadLine1");
|
||||
GameRegistry.registerBlock(road_line1, ItemCarvable.class, "road_line1");
|
||||
BlockRoadLine road_line2 = (BlockRoadLine) new BlockRoadLine("double-white").setStepSound(Block.soundTypeStone).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.01F)
|
||||
.setBlockName("roadLine2");
|
||||
GameRegistry.registerBlock(road_line2, ItemCarvable.class, "road_line2");
|
||||
BlockRoadLine road_line3 = (BlockRoadLine) new BlockRoadLine("double-yellow").setStepSound(Block.soundTypeStone).setCreativeTab(ChiselTabs.tabOtherChiselBlocks).setHardness(0.01F)
|
||||
.setBlockName("roadLine3");
|
||||
GameRegistry.registerBlock(road_line3, ItemCarvable.class, "road_line3");
|
||||
Carving.chisel.addVariation("roadLine", road_line1, 0, 1);
|
||||
Carving.chisel.addVariation("roadLine", road_line2, 0, 2);
|
||||
Carving.chisel.addVariation("roadLine", road_line3, 0, 3);
|
||||
Carving.chisel.registerOre("roadLine", "roadLine");
|
||||
}
|
||||
|
||||
|
||||
@@ -547,10 +547,11 @@ tile.concrete.9.desc=Partly Weathered Concrete Block
|
||||
tile.concrete.10.desc=Asphalt
|
||||
|
||||
#Road Line
|
||||
tile.roadLine.name=Road Lines (White)
|
||||
tile.roadLine1.name=Road Lines (Double White)
|
||||
tile.roadLine2.name=Road Lines (Yellow)
|
||||
tile.roadLine3.name=Road Lines (Double Yellow)
|
||||
tile.roadLine.name=Road Lines
|
||||
tile.roadLine.0.desc=White
|
||||
tile.roadLine.1.desc=Double White
|
||||
tile.roadLine.2.desc=Yellow
|
||||
tile.roadLine.3.desc=Double Yellow
|
||||
|
||||
#Iron Blocks
|
||||
tile.iron_block.name=Iron Block
|
||||
|
||||
Reference in new issue
Block a user