mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-16 10:45:02 +00:00
final fixes
Added the rest of suggestions, made one class for glotek and neonite, made variable names more descriptive and removed SideOnly
This commit is contained in:
1 parent
1be95d427a
commit
bfbdcb07cf
6 files changed
+55
-127
No files matched your search
@@ -23,6 +23,7 @@ import team.chisel.block.*;
|
||||
import team.chisel.block.BlockCarvableNeonite;
|
||||
import team.chisel.carving.Carving;
|
||||
import team.chisel.client.render.*;
|
||||
import team.chisel.client.render.SubmapManagerSpecialMaterial;
|
||||
import team.chisel.compat.fmp.ItemBlockChiselTorchPart;
|
||||
import team.chisel.config.Configurations;
|
||||
import team.chisel.entity.EntityBallOMoss;
|
||||
@@ -837,8 +838,8 @@ public enum Features {
|
||||
@Override
|
||||
void addBlocks() {
|
||||
BlockCarvable cubit = (BlockCarvable) new BlockCarvable(Material.rock)
|
||||
.setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(0.8F).setResistance(10.0F)
|
||||
.setStepSound(Block.soundTypeStone);
|
||||
.setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(0.8F).setResistance(10.0F)
|
||||
.setStepSound(Block.soundTypeStone);
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
cubit.carverHelper.addVariation("tile.cubit." + i + ".desc", i, "cubit/" + i);
|
||||
@@ -861,7 +862,6 @@ public enum Features {
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
DIAMOND_BLOCK {
|
||||
|
||||
@Override
|
||||
@@ -1345,8 +1345,12 @@ public enum Features {
|
||||
}
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
glotek.carverHelper
|
||||
.addVariation("tile.glotek." + i + ".desc", i, new SubmapManagerGlotek(String.valueOf(i)));
|
||||
glotek.carverHelper.addVariation(
|
||||
"tile.glotek." + i + ".desc",
|
||||
i,
|
||||
new SubmapManagerSpecialMaterial(
|
||||
String.valueOf(i),
|
||||
SubmapManagerSpecialMaterial.MaterialType.GLOTEK));
|
||||
}
|
||||
|
||||
glotek.carverHelper.registerAll(glotek, "glotek");
|
||||
@@ -1366,6 +1370,7 @@ public enum Features {
|
||||
new ItemStack(Items.glowstone_dust, 1));
|
||||
}
|
||||
},
|
||||
|
||||
GLOWSTONE {
|
||||
|
||||
@Override
|
||||
@@ -1593,13 +1598,13 @@ public enum Features {
|
||||
@Override
|
||||
void addBlocks() {
|
||||
BlockCarvable hempcrete = (BlockCarvable) new BlockCarvable(Material.rock)
|
||||
.setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(0.8F).setResistance(10.0F)
|
||||
.setStepSound(Block.soundTypeStone);
|
||||
.setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(0.8F).setResistance(10.0F)
|
||||
.setStepSound(Block.soundTypeStone);
|
||||
|
||||
for (int i = 0; i < 16; i++) hempcrete.carverHelper.addVariation(
|
||||
"tile.hempcrete." + i + ".desc",
|
||||
i,
|
||||
"hempCrete/concrete/" + sGNames[i].replaceAll(" ", "").toLowerCase());
|
||||
"tile.hempcrete." + i + ".desc",
|
||||
i,
|
||||
"hempCrete/concrete/" + sGNames[i].replaceAll(" ", "").toLowerCase());
|
||||
hempcrete.carverHelper.registerAll(hempcrete, "hempcrete");
|
||||
}
|
||||
|
||||
@@ -1607,7 +1612,10 @@ public enum Features {
|
||||
void addRecipes() {
|
||||
for (int i = 0; i < 16; i++) {
|
||||
|
||||
GameRegistry.addSmelting(new ItemStack(ChiselBlocks.hempcretesand, 1, i), new ItemStack(ChiselBlocks.hempcrete, 1, i), 20F);
|
||||
GameRegistry.addSmelting(
|
||||
new ItemStack(ChiselBlocks.hempcretesand, 1, i),
|
||||
new ItemStack(ChiselBlocks.hempcrete, 1, i),
|
||||
20F);
|
||||
|
||||
GameRegistry.addSmelting(
|
||||
new ItemStack(ChiselBlocks.hempcretesand, 1, i),
|
||||
@@ -1623,14 +1631,14 @@ public enum Features {
|
||||
@Override
|
||||
void addBlocks() {
|
||||
BlockCarvableSand hempcretesand = (BlockCarvableSand) new BlockCarvableSand()
|
||||
.setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(0.5F).setResistance(0.5F)
|
||||
.setStepSound(Block.soundTypeSand);
|
||||
.setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(0.5F).setResistance(0.5F)
|
||||
.setStepSound(Block.soundTypeSand);
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
hempcretesand.carverHelper.addVariation(
|
||||
"tile.hempcretesand." + i + ".desc",
|
||||
i,
|
||||
"hempCrete/sand/" + sGNames[i].replaceAll(" ", "").toLowerCase());
|
||||
"tile.hempcretesand." + i + ".desc",
|
||||
i,
|
||||
"hempCrete/sand/" + sGNames[i].replaceAll(" ", "").toLowerCase());
|
||||
}
|
||||
|
||||
hempcretesand.carverHelper.registerAll(hempcretesand, "hempcretesand");
|
||||
@@ -2467,8 +2475,13 @@ public enum Features {
|
||||
}
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
neonite.carverHelper
|
||||
.addVariation("tile.neonite." + i + ".desc", i, new SubmapManagerNeonite(String.valueOf(i)));
|
||||
neonite.carverHelper.addVariation(
|
||||
"tile.neonite." + i + ".desc",
|
||||
i,
|
||||
new SubmapManagerSpecialMaterial(
|
||||
String.valueOf(i),
|
||||
SubmapManagerSpecialMaterial.MaterialType.NEONITE));
|
||||
|
||||
}
|
||||
|
||||
neonite.carverHelper.registerAll(neonite, "neonite");
|
||||
@@ -3354,8 +3367,8 @@ public enum Features {
|
||||
@Override
|
||||
void addBlocks() {
|
||||
BlockCarvable svelstone = (BlockCarvable) new BlockCarvable(Material.rock)
|
||||
.setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(5.0F).setResistance(10.0F)
|
||||
.setStepSound(Block.soundTypeStone);
|
||||
.setCreativeTab(ChiselTabs.tabStoneChiselBlocks).setHardness(5.0F).setResistance(10.0F)
|
||||
.setStepSound(Block.soundTypeStone);
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
svelstone.carverHelper.addVariation("tile.sveltstone." + i + ".desc", i, "sveltstone/" + i);
|
||||
@@ -3378,7 +3391,6 @@ public enum Features {
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
TALLOW("Thaumcraft") {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,8 +4,6 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
|
||||
public class BlockCarvableGlotek extends BlockCarvable {
|
||||
|
||||
public BlockCarvableGlotek() {
|
||||
|
||||
@@ -4,8 +4,6 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
|
||||
public class BlockCarvableNeonite extends BlockCarvable {
|
||||
|
||||
public BlockCarvableNeonite() {
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
package team.chisel.client.render;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import team.chisel.ctmlib.RenderBlocksCTM;
|
||||
import team.chisel.ctmlib.TextureSubmap;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SubmapManagerNeonite extends SubmapManagerBase {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static class RenderBlocksCTMFullbright extends RenderBlocksCTM {
|
||||
|
||||
@Override
|
||||
protected void fillLightmap(int bottomLeft, int bottomRight, int topRight, int topLeft) {
|
||||
ao();
|
||||
int maxLight = 0xF000F0;
|
||||
super.fillLightmap(maxLight, maxLight, maxLight, maxLight);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillColormap(float bottomLeft, float bottomRight, float topRight, float topLeft, float[][] map) {
|
||||
ao();
|
||||
int color = 0xFFFFFF;
|
||||
super.fillColormap(color, color, color, color, map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderStandardBlock(Block block, int x, int y, int z) {
|
||||
boolean ret = super.renderStandardBlock(block, x, y, z);
|
||||
this.enableAO = false;
|
||||
return ret;
|
||||
}
|
||||
|
||||
private void ao() {
|
||||
if (this.inWorld) {
|
||||
this.enableAO = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static RenderBlocksCTMFullbright rb;
|
||||
|
||||
private String color;
|
||||
private TextureSubmap submap, submapSmall;
|
||||
|
||||
public SubmapManagerNeonite(String color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return submapSmall.getBaseIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(String modName, Block block, IIconRegister register) {
|
||||
submap = new TextureSubmap(register.registerIcon(modName + ":Neonite/" + color + "-ctm"), 4, 4);
|
||||
submapSmall = new TextureSubmap(register.registerIcon(modName + ":Neonite/" + color), 2, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) {
|
||||
if (rb == null) {
|
||||
rb = new RenderBlocksCTMFullbright();
|
||||
}
|
||||
rb.setRenderBoundsFromBlock(block);
|
||||
rb.submap = submap;
|
||||
rb.submapSmall = submapSmall;
|
||||
return rb;
|
||||
}
|
||||
}
|
||||
+22
-20
@@ -8,24 +8,26 @@ import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import team.chisel.ctmlib.RenderBlocksCTM;
|
||||
import team.chisel.ctmlib.TextureSubmap;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SubmapManagerGlotek extends SubmapManagerBase {
|
||||
public class SubmapManagerSpecialMaterial extends SubmapManagerBase {
|
||||
|
||||
public enum MaterialType {
|
||||
NEONITE,
|
||||
GLOTEK
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static class RenderBlocksCTMFullbright extends RenderBlocksCTM {
|
||||
|
||||
@Override
|
||||
protected void fillLightmap(int bottomLeft, int bottomRight, int topRight, int topLeft) {
|
||||
ao();
|
||||
enableAmbientOcclusionIfInWorld();
|
||||
int maxLight = 0xF000F0;
|
||||
super.fillLightmap(maxLight, maxLight, maxLight, maxLight);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillColormap(float bottomLeft, float bottomRight, float topRight, float topLeft, float[][] map) {
|
||||
ao();
|
||||
enableAmbientOcclusionIfInWorld();
|
||||
int color = 0xFFFFFF;
|
||||
super.fillColormap(color, color, color, color, map);
|
||||
}
|
||||
@@ -37,21 +39,22 @@ public class SubmapManagerGlotek extends SubmapManagerBase {
|
||||
return ret;
|
||||
}
|
||||
|
||||
private void ao() {
|
||||
private void enableAmbientOcclusionIfInWorld() {
|
||||
if (this.inWorld) {
|
||||
this.enableAO = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static RenderBlocksCTMFullbright rb;
|
||||
private static RenderBlocksCTMFullbright renderBlocksFullbright;
|
||||
|
||||
private String color;
|
||||
private MaterialType materialType;
|
||||
private TextureSubmap submap, submapSmall;
|
||||
|
||||
public SubmapManagerGlotek(String color) {
|
||||
public SubmapManagerSpecialMaterial(String color, MaterialType materialType) {
|
||||
this.color = color;
|
||||
this.materialType = materialType;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -60,21 +63,20 @@ public class SubmapManagerGlotek extends SubmapManagerBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(String modName, Block block, IIconRegister register) {
|
||||
submap = new TextureSubmap(register.registerIcon(modName + ":Glotek/" + color + "-ctm"), 4, 4);
|
||||
submapSmall = new TextureSubmap(register.registerIcon(modName + ":Glotek/" + color), 2, 2);
|
||||
String materialName = materialType.name().toLowerCase();
|
||||
submap = new TextureSubmap(register.registerIcon(modName + ":" + materialName + "/" + color + "-ctm"), 4, 4);
|
||||
submapSmall = new TextureSubmap(register.registerIcon(modName + ":" + materialName + "/" + color), 2, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public RenderBlocks createRenderContext(RenderBlocks rendererOld, Block block, IBlockAccess world) {
|
||||
if (rb == null) {
|
||||
rb = new RenderBlocksCTMFullbright();
|
||||
if (renderBlocksFullbright == null) {
|
||||
renderBlocksFullbright = new RenderBlocksCTMFullbright();
|
||||
}
|
||||
rb.setRenderBoundsFromBlock(block);
|
||||
rb.submap = submap;
|
||||
rb.submapSmall = submapSmall;
|
||||
return rb;
|
||||
renderBlocksFullbright.setRenderBoundsFromBlock(block);
|
||||
renderBlocksFullbright.submap = submap;
|
||||
renderBlocksFullbright.submapSmall = submapSmall;
|
||||
return renderBlocksFullbright;
|
||||
}
|
||||
}
|
||||
@@ -111,8 +111,6 @@ public final class ChiselBlocks {
|
||||
|
||||
public static final BlockCarvable hempcrete = null;
|
||||
|
||||
|
||||
|
||||
public static final BlockCarvable sveltstone = null;
|
||||
public static final BlockCarvable cubit = null;
|
||||
|
||||
|
||||
Reference in new issue
Block a user