mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-20 12:19:46 +00:00
Rendering tweaks, and fix up all stairs/slabs/walls
This commit is contained in:
1 parent
a23f317368
commit
320f6405e4
36 files changed
+184
-111
No files matched your search
@@ -19,12 +19,6 @@ public class BotaniaStateProps {
|
||||
|
||||
/** Common properties to all blocks to use **/
|
||||
|
||||
// Cardinal connection booleans (think fence or wall)
|
||||
public static final PropertyBool CONNECT_NORTH = PropertyBool.create("north");
|
||||
public static final PropertyBool CONNECT_SOUTH = PropertyBool.create("south");
|
||||
public static final PropertyBool CONNECT_WEST = PropertyBool.create("west");
|
||||
public static final PropertyBool CONNECT_EAST = PropertyBool.create("east");
|
||||
|
||||
// The 16 Minecraft colors
|
||||
public static final PropertyEnum COLOR = PropertyEnum.create("color", EnumDyeColor.class);
|
||||
|
||||
@@ -51,7 +45,7 @@ public class BotaniaStateProps {
|
||||
|
||||
/** Properties for individual blocks **/
|
||||
|
||||
// Block18Stone,
|
||||
// Block18Stone
|
||||
public static final PropertyEnum FUTURESTONE_VARIANT = PropertyEnum.create("variant", FutureStoneVariant.class);
|
||||
|
||||
// Block18StoneWall
|
||||
|
||||
@@ -25,6 +25,7 @@ import net.minecraft.client.renderer.ActiveRenderInfo;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.profiler.Profiler;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -87,15 +88,13 @@ public class LightningHandler {
|
||||
ParticleRenderDispatcher.lightningCount = 0;
|
||||
|
||||
render.bindTexture(outsideResource);
|
||||
tessellator.getWorldRenderer().startDrawingQuads();
|
||||
tessellator.getWorldRenderer().setBrightness(0xF000F0);
|
||||
tessellator.getWorldRenderer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_LMAP_COLOR);
|
||||
for(LightningBolt bolt : LightningBolt.boltlist)
|
||||
renderBolt(bolt, tessellator, frame, ActiveRenderInfo.getRotationX(), ActiveRenderInfo.getRotationXZ(), ActiveRenderInfo.getRotationZ(), ActiveRenderInfo.getRotationXY(), 0, false);
|
||||
tessellator.draw();
|
||||
|
||||
render.bindTexture(insideResource);
|
||||
tessellator.getWorldRenderer().startDrawingQuads();
|
||||
tessellator.getWorldRenderer().setBrightness(0xF000F0);
|
||||
tessellator.getWorldRenderer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_LMAP_COLOR);
|
||||
for(LightningBolt bolt : LightningBolt.boltlist)
|
||||
renderBolt(bolt, tessellator, frame, ActiveRenderInfo.getRotationX(), ActiveRenderInfo.getRotationXZ(), ActiveRenderInfo.getRotationZ(), ActiveRenderInfo.getRotationXY(), 1, true);
|
||||
tessellator.draw();
|
||||
@@ -146,29 +145,32 @@ public class LightningHandler {
|
||||
Vector3 endvec = rendersegment.endpoint.point;
|
||||
|
||||
int color = inner ? bolt.colorInner : bolt.colorOuter;
|
||||
tessellator.getWorldRenderer().putColor(color, (int) (mainalpha * rendersegment.light * new Color(color).getAlpha()));
|
||||
int r = (color & 0xFF0000) >> 16;
|
||||
int g = (color & 0xFF00) >> 8;
|
||||
int b = (color & 0xFF);
|
||||
int a = (int) (mainalpha * rendersegment.light * new Color(color).getAlpha());
|
||||
|
||||
tessellator.getWorldRenderer().pos(endvec.x - diff2.x, endvec.y - diff2.y, endvec.z - diff2.z).tex(0.5, 0).endVertex();
|
||||
tessellator.getWorldRenderer().pos(startvec.x - diff1.x, startvec.y - diff1.y, startvec.z - diff1.z).tex(0.5, 0).endVertex();
|
||||
tessellator.getWorldRenderer().pos(startvec.x + diff1.x, startvec.y + diff1.y, startvec.z + diff1.z).tex(0.5, 1).endVertex();
|
||||
tessellator.getWorldRenderer().pos(endvec.x + diff2.x, endvec.y + diff2.y, endvec.z + diff2.z).tex(0.5, 1).endVertex();
|
||||
tessellator.getWorldRenderer().pos(endvec.x - diff2.x, endvec.y - diff2.y, endvec.z - diff2.z).lightmap(0xF0, 0xF0).tex(0.5, 0).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(startvec.x - diff1.x, startvec.y - diff1.y, startvec.z - diff1.z).lightmap(0xF0, 0xF0).tex(0.5, 0).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(startvec.x + diff1.x, startvec.y + diff1.y, startvec.z + diff1.z).lightmap(0xF0, 0xF0).tex(0.5, 1).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(endvec.x + diff2.x, endvec.y + diff2.y, endvec.z + diff2.z).lightmap(0xF0, 0xF0).tex(0.5, 1).color(r, g, b, a).endVertex();
|
||||
|
||||
if(rendersegment.next == null) {
|
||||
Vector3 roundend = rendersegment.endpoint.point.copy().add(rendersegment.diff.copy().normalize().multiply(width));
|
||||
|
||||
tessellator.getWorldRenderer().pos(roundend.x - diff2.x, roundend.y - diff2.y, roundend.z - diff2.z).tex(0, 0).endVertex();
|
||||
tessellator.getWorldRenderer().pos(endvec.x - diff2.x, endvec.y - diff2.y, endvec.z - diff2.z).tex(0.5, 0).endVertex();
|
||||
tessellator.getWorldRenderer().pos(endvec.x + diff2.x, endvec.y + diff2.y, endvec.z + diff2.z).tex(0.5, 1).endVertex();
|
||||
tessellator.getWorldRenderer().pos(roundend.x + diff2.x, roundend.y + diff2.y, roundend.z + diff2.z).tex(0, 1).endVertex();
|
||||
tessellator.getWorldRenderer().pos(roundend.x - diff2.x, roundend.y - diff2.y, roundend.z - diff2.z).lightmap(0xF0, 0xF0).tex(0, 0).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(endvec.x - diff2.x, endvec.y - diff2.y, endvec.z - diff2.z).lightmap(0xF0, 0xF0).tex(0.5, 0).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(endvec.x + diff2.x, endvec.y + diff2.y, endvec.z + diff2.z).lightmap(0xF0, 0xF0).tex(0.5, 1).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(roundend.x + diff2.x, roundend.y + diff2.y, roundend.z + diff2.z).lightmap(0xF0, 0xF0).tex(0, 1).color(r, g, b, a).endVertex();
|
||||
}
|
||||
|
||||
if(rendersegment.prev == null) {
|
||||
Vector3 roundend = rendersegment.startpoint.point.copy().subtract(rendersegment.diff.copy().normalize().multiply(width));
|
||||
|
||||
tessellator.getWorldRenderer().pos(startvec.x - diff1.x, startvec.y - diff1.y, startvec.z - diff1.z).tex(0.5, 0).endVertex();
|
||||
tessellator.getWorldRenderer().pos(roundend.x - diff1.x, roundend.y - diff1.y, roundend.z - diff1.z).tex(0, 0).endVertex();
|
||||
tessellator.getWorldRenderer().pos(roundend.x + diff1.x, roundend.y + diff1.y, roundend.z + diff1.z).tex(0, 1).endVertex();
|
||||
tessellator.getWorldRenderer().pos(startvec.x + diff1.x, startvec.y + diff1.y, startvec.z + diff1.z).tex(0.5, 1).endVertex();
|
||||
tessellator.getWorldRenderer().pos(startvec.x - diff1.x, startvec.y - diff1.y, startvec.z - diff1.z).lightmap(0xF0, 0xF0).tex(0.5, 0).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(roundend.x - diff1.x, roundend.y - diff1.y, roundend.z - diff1.z).lightmap(0xF0, 0xF0).tex(0, 0).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(roundend.x + diff1.x, roundend.y + diff1.y, roundend.z + diff1.z).lightmap(0xF0, 0xF0).tex(0, 1).color(r, g, b, a).endVertex();
|
||||
tessellator.getWorldRenderer().pos(startvec.x + diff1.x, startvec.y + diff1.y, startvec.z + diff1.z).lightmap(0xF0, 0xF0).tex(0.5, 1).color(r, g, b, a).endVertex();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,9 +173,12 @@ public final class RenderHelper {
|
||||
tessellator.getWorldRenderer().begin(GL11.GL_TRIANGLE_FAN, DefaultVertexFormats.POSITION_COLOR);
|
||||
float f3 = random.nextFloat() * 20F + 5F + f2 * 10F;
|
||||
float f4 = random.nextFloat() * 2F + 1F + f2 * 2F;
|
||||
tessellator.getWorldRenderer().setColorRGBA_I(color, (int) (255F * (1F - f2)));
|
||||
tessellator.getWorldRenderer().pos(0, 0, 0).color().endVertex();
|
||||
tessellator.getWorldRenderer().setColorRGBA_F(0F, 0F, 0F, 0);
|
||||
int r = (color & 0xFF0000) >> 16;
|
||||
int g = (color & 0xFF00) >> 8;
|
||||
int b = (color & 0xFF);
|
||||
tessellator.getWorldRenderer().putColorMultiplier(r, g, b, (int) (255F * (1F - f2)));
|
||||
tessellator.getWorldRenderer().pos(0, 0, 0).endVertex();
|
||||
tessellator.getWorldRenderer().putColorMultiplier(0F, 0F, 0F, 0);
|
||||
tessellator.getWorldRenderer().pos(-0.866D * f4, f3, -0.5F * f4).endVertex();
|
||||
tessellator.getWorldRenderer().pos(0.866D * f4, f3, -0.5F * f4).endVertex();
|
||||
tessellator.getWorldRenderer().pos(0, f3, 1F * f4).endVertex();
|
||||
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -60,7 +61,7 @@ public class RenderBabylonWeapon extends Render {
|
||||
GlStateManager.scale(s, s, s);
|
||||
GlStateManager.rotate(-90F, 0F, 1F, 0F);
|
||||
GlStateManager.rotate(45F, 0F, 0F, 1F);
|
||||
IIcon icon = ItemKingKey.weaponIcons[weapon.getVariety()];
|
||||
TextureAtlasSprite icon = ItemKingKey.weaponIcons[weapon.getVariety()];
|
||||
GlStateManager.color(1F, 1F, 1F, chargeMul);
|
||||
float f = icon.getMinU();
|
||||
float f1 = icon.getMaxU();
|
||||
|
||||
@@ -15,9 +15,11 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -31,6 +33,10 @@ import vazkii.botania.common.item.ItemCorporeaSpark;
|
||||
|
||||
public class RenderCorporeaSpark extends RenderSparkBase<EntityCorporeaSpark> {
|
||||
|
||||
public RenderCorporeaSpark(RenderManager p_i46185_1_) {
|
||||
super(p_i46185_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TextureAtlasSprite getBaseIcon(EntityCorporeaSpark entity) {
|
||||
return entity.isMaster() ? ItemCorporeaSpark.worldIconMaster : ItemCorporeaSpark.worldIcon;
|
||||
@@ -39,6 +45,8 @@ public class RenderCorporeaSpark extends RenderSparkBase<EntityCorporeaSpark> {
|
||||
@Override
|
||||
public void colorSpinningIcon(EntityCorporeaSpark entity, float a) {
|
||||
int network = Math.min(15, entity.getNetwork());
|
||||
int hex = EnumDyeColor.byMetadata(network).getMapColor().colorValue;
|
||||
|
||||
GlStateManager.color(EntitySheep.fleeceColorTable[network][0], EntitySheep.fleeceColorTable[network][1], EntitySheep.fleeceColorTable[network][2], a);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,11 @@
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.BiomeBrickVariant;
|
||||
import vazkii.botania.api.state.enums.BiomeStoneVariant;
|
||||
import vazkii.botania.api.state.enums.FutureStoneVariant;
|
||||
import vazkii.botania.common.block.decor.Block18Stone;
|
||||
import vazkii.botania.common.block.decor.BlockPavement;
|
||||
import vazkii.botania.common.block.decor.biomestone.BlockBiomeStoneA;
|
||||
@@ -77,6 +82,8 @@ import vazkii.botania.common.block.decor.walls.living.BlockLivingwoodWall;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public final class ModFluffBlocks {
|
||||
|
||||
public static Block livingwoodStairs;
|
||||
@@ -297,27 +304,40 @@ public final class ModFluffBlocks {
|
||||
dirtPathSlab = new BlockDirtPathSlab(false);
|
||||
dirtPathSlabFull = new BlockDirtPathSlab(true);
|
||||
|
||||
for(int i = 0; i < 24; i++) {
|
||||
int meta = i % 16;
|
||||
Block block = i < 16 ? biomeStoneA : biomeStoneB;
|
||||
biomeStoneStairs[i] = new BlockBiomeStoneStairs(block, meta);
|
||||
biomeStoneSlabs[i] = new BlockBiomeStoneSlab(false, block, meta, i);
|
||||
biomeStoneFullSlabs[i] = new BlockBiomeStoneSlab(true, block, meta, i);
|
||||
int count = 0;
|
||||
for (BiomeStoneVariant variant : BiomeStoneVariant.values()) {
|
||||
biomeStoneStairs[count] = new BlockBiomeStoneStairs(biomeStoneA.getDefaultState().withProperty(BotaniaStateProps.BIOMESTONE_VARIANT, variant));
|
||||
biomeStoneSlabs[count] = new BlockBiomeStoneSlab(false, biomeStoneA.getDefaultState().withProperty(BotaniaStateProps.BIOMESTONE_VARIANT, variant), count);
|
||||
biomeStoneFullSlabs[count] = new BlockBiomeStoneSlab(true, biomeStoneA.getDefaultState().withProperty(BotaniaStateProps.BIOMESTONE_VARIANT, variant), count);
|
||||
count++;
|
||||
}
|
||||
|
||||
for (BiomeBrickVariant variant : BiomeBrickVariant.values()) {
|
||||
biomeStoneStairs[count] = new BlockBiomeStoneStairs(biomeStoneB.getDefaultState().withProperty(BotaniaStateProps.BIOMEBRICK_VARIANT, variant));
|
||||
biomeStoneSlabs[count] = new BlockBiomeStoneSlab(false, biomeStoneB.getDefaultState().withProperty(BotaniaStateProps.BIOMEBRICK_VARIANT, variant), count);
|
||||
biomeStoneFullSlabs[count] = new BlockBiomeStoneSlab(true, biomeStoneB.getDefaultState().withProperty(BotaniaStateProps.BIOMEBRICK_VARIANT, variant), count);
|
||||
count++;
|
||||
}
|
||||
biomeStoneWall = new BlockBiomeStoneWall();
|
||||
|
||||
for(int i = 0; i < 8; i++) {
|
||||
int meta = i > 3 ? i + 4 : i;
|
||||
stoneStairs[i] = new Block18StoneStairs(meta);
|
||||
stoneSlabs[i] = new Block18StoneSlab(false, meta, i);
|
||||
stoneFullSlabs[i] = new Block18StoneSlab(true, meta, i);
|
||||
count = 0;
|
||||
for(FutureStoneVariant variant : FutureStoneVariant.values()) {
|
||||
if (!(variant.ordinal() >= 0 && variant.ordinal() <= 3 || variant.ordinal() >= 8 && variant.ordinal() <= 11)) {
|
||||
// Filter - only get the base blocks, and the brick versions
|
||||
continue;
|
||||
}
|
||||
|
||||
stoneStairs[count] = new Block18StoneStairs(variant);
|
||||
stoneSlabs[count] = new Block18StoneSlab(false, variant, count);
|
||||
stoneFullSlabs[count] = new Block18StoneSlab(true, variant, count);
|
||||
count++;
|
||||
}
|
||||
stoneWall = new Block18StoneWall();
|
||||
|
||||
for(int i = 0; i < pavementStairs.length; i++) {
|
||||
pavementStairs[i] = new BlockPavementStairs(i);
|
||||
pavementSlabs[i] = new BlockPavementSlab(false, i, i);
|
||||
pavementFullSlabs[i] = new BlockPavementSlab(true, i, i);
|
||||
count = 0;
|
||||
for (EnumDyeColor color : ((Collection<EnumDyeColor>) BotaniaStateProps.PAVEMENT_COLOR.getAllowedValues())) {
|
||||
pavementStairs[count] = new BlockPavementStairs(color);
|
||||
count++;
|
||||
}
|
||||
|
||||
endStoneSlab = new BlockEndStoneSlab(false);
|
||||
|
||||
@@ -96,21 +96,6 @@ public class BlockSpecialQuartzSlab extends BlockModSlab {
|
||||
return new ItemStack(getSingleBlock());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDouble() {
|
||||
return getFullBlock() == this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IProperty getVariantProperty() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getVariant(ItemStack stack) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) {
|
||||
return this == ModFluffBlocks.elfQuartzSlab ? LexiconData.elvenResources : LexiconData.decorativeBlocks;
|
||||
|
||||
@@ -16,6 +16,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.FutureStoneVariant;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
@@ -23,8 +25,8 @@ public class Block18StoneSlab extends BlockLivingSlab {
|
||||
|
||||
int index;
|
||||
|
||||
public Block18StoneSlab(boolean full, int meta, int index) {
|
||||
super(full, ModFluffBlocks.stone, meta);
|
||||
public Block18StoneSlab(boolean full, FutureStoneVariant variant, int index) {
|
||||
super(full, ModFluffBlocks.stone.getDefaultState().withProperty(BotaniaStateProps.FUTURESTONE_VARIANT, variant));
|
||||
this.index = index;
|
||||
setHardness(1.5F);
|
||||
setResistance(10F);
|
||||
|
||||
@@ -12,6 +12,7 @@ package vazkii.botania.common.block.decor.slabs;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
@@ -24,8 +25,8 @@ public class BlockBiomeStoneSlab extends BlockLivingSlab {
|
||||
|
||||
int index;
|
||||
|
||||
public BlockBiomeStoneSlab(boolean full, Block source, int meta, int index) {
|
||||
super(full, source, meta);
|
||||
public BlockBiomeStoneSlab(boolean full, IBlockState state, int index) {
|
||||
super(full, state);
|
||||
this.index = index;
|
||||
setHardness(1.5F);
|
||||
setResistance(10F);
|
||||
|
||||
@@ -23,7 +23,7 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
public class BlockDirtPathSlab extends BlockLivingSlab {
|
||||
|
||||
public BlockDirtPathSlab(boolean full) {
|
||||
super(full, ModBlocks.dirtPath, 0);
|
||||
super(full, ModBlocks.dirtPath.getDefaultState());
|
||||
setHardness(0.6F);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
public class BlockEndStoneSlab extends BlockLivingSlab {
|
||||
|
||||
public BlockEndStoneSlab(boolean full) {
|
||||
super(full, ModBlocks.endStoneBrick, 0);
|
||||
super(full, ModBlocks.endStoneBrick.getDefaultState());
|
||||
setHardness(1.5F);
|
||||
setResistance(10F);
|
||||
setStepSound(soundTypeStone);
|
||||
|
||||
@@ -16,6 +16,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.EndBrickVariant;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
@@ -23,7 +25,7 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
public class BlockEnderBrickSlab extends BlockLivingSlab {
|
||||
|
||||
public BlockEnderBrickSlab(boolean full) {
|
||||
super(full, ModBlocks.endStoneBrick, 2);
|
||||
super(full, ModBlocks.endStoneBrick.getDefaultState().withProperty(BotaniaStateProps.ENDBRICK_VARIANT, EndBrickVariant.ENDER_BRICKS));
|
||||
setHardness(1.5F);
|
||||
setResistance(10F);
|
||||
setStepSound(soundTypeStone);
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
package vazkii.botania.common.block.decor.slabs;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public abstract class BlockLivingSlab extends BlockModSlab {
|
||||
|
||||
Block source;
|
||||
int meta;
|
||||
IBlockState sourceState;
|
||||
|
||||
public BlockLivingSlab(boolean full, Block source, int meta) {
|
||||
super(full, source.getMaterial(), source.getUnlocalizedName().replaceAll("tile.", "") + meta + "Slab" + (full ? "Full" : ""));
|
||||
setStepSound(source.stepSound);
|
||||
this.source = source;
|
||||
this.meta = meta;
|
||||
public BlockLivingSlab(boolean full, IBlockState state) {
|
||||
super(full, state.getBlock().getMaterial(), state.getBlock().getUnlocalizedName().replaceAll("tile.", "") + state.getBlock().getMetaFromState(state) + "Slab" + (full ? "Full" : ""));
|
||||
setStepSound(state.getBlock().stepSound);
|
||||
this.sourceState = state;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,11 +5,14 @@ import java.util.Random;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
@@ -24,15 +27,34 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
public abstract class BlockModSlab extends BlockSlab implements ILexiconable {
|
||||
|
||||
String name;
|
||||
protected final boolean doubleSlab;
|
||||
public static final PropertyEnum DUMMY = PropertyEnum.create("dummy", DummyEnum.class); // todo 1.8.8 statemapper ignore this prop for everything
|
||||
|
||||
public BlockModSlab(boolean full, Material mat, String name) {
|
||||
super(mat);
|
||||
this.name = name;
|
||||
setUnlocalizedName(name);
|
||||
doubleSlab = full;
|
||||
if(!full) {
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
useNeighborBrightness = true;
|
||||
}
|
||||
setDefaultState(blockState.getBaseState().withProperty(DUMMY, DummyEnum.SINGLETON));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState createBlockState() {
|
||||
return new BlockState(this, getVariantProperty());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getDefaultState();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public abstract BlockSlab getFullBlock();
|
||||
@@ -69,17 +91,32 @@ public abstract class BlockModSlab extends BlockSlab implements ILexiconable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract boolean isDouble();
|
||||
public final boolean isDouble() {
|
||||
return doubleSlab;
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract IProperty getVariantProperty();
|
||||
public final IProperty getVariantProperty() {
|
||||
return DUMMY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public abstract Object getVariant(ItemStack stack);
|
||||
public final Object getVariant(ItemStack stack) {
|
||||
return DummyEnum.SINGLETON;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) {
|
||||
return LexiconData.decorativeBlocks;
|
||||
}
|
||||
|
||||
public enum DummyEnum implements IStringSerializable {
|
||||
SINGLETON {
|
||||
@Override
|
||||
public String getName() {
|
||||
return name();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,10 +12,12 @@ package vazkii.botania.common.block.decor.slabs;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
@@ -23,8 +25,8 @@ public class BlockPavementSlab extends BlockLivingSlab {
|
||||
|
||||
int index;
|
||||
|
||||
public BlockPavementSlab(boolean full, int meta, int index) {
|
||||
super(full, ModFluffBlocks.pavement, meta);
|
||||
public BlockPavementSlab(boolean full, EnumDyeColor color, int index) {
|
||||
super(full, ModFluffBlocks.pavement.getDefaultState().withProperty(BotaniaStateProps.PAVEMENT_COLOR, color));
|
||||
this.index = index;
|
||||
setHardness(2F);
|
||||
setResistance(10F);
|
||||
|
||||
@@ -23,7 +23,7 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
public class BlockReedSlab extends BlockLivingSlab {
|
||||
|
||||
public BlockReedSlab(boolean full) {
|
||||
super(full, ModBlocks.reedBlock, 0);
|
||||
super(full, ModBlocks.reedBlock.getDefaultState());
|
||||
setHardness(1.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
public class BlockThatchSlab extends BlockLivingSlab {
|
||||
|
||||
public BlockThatchSlab(boolean full) {
|
||||
super(full, ModBlocks.thatch, 0);
|
||||
super(full, ModBlocks.thatch.getDefaultState());
|
||||
setHardness(1.0F);
|
||||
setStepSound(soundTypeGrass);
|
||||
}
|
||||
|
||||
+5
-3
@@ -16,6 +16,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.CustomBrickVariant;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
import vazkii.botania.common.block.decor.slabs.BlockLivingSlab;
|
||||
@@ -24,11 +26,11 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
public class BlockCustomBrickSlab extends BlockLivingSlab {
|
||||
|
||||
public BlockCustomBrickSlab(boolean full) {
|
||||
this(full, 0);
|
||||
this(full, CustomBrickVariant.HELLISH_BRICK);
|
||||
}
|
||||
|
||||
public BlockCustomBrickSlab(boolean full, int meta) {
|
||||
super(full, ModBlocks.customBrick, meta);
|
||||
public BlockCustomBrickSlab(boolean full, CustomBrickVariant variant) {
|
||||
super(full, ModBlocks.customBrick.getDefaultState().withProperty(BotaniaStateProps.CUSTOMBRICK_VARIANT, variant));
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
|
||||
+2
-1
@@ -11,12 +11,13 @@
|
||||
package vazkii.botania.common.block.decor.slabs.bricks;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import vazkii.botania.api.state.enums.CustomBrickVariant;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
|
||||
public class BlockSnowBrickSlab extends BlockCustomBrickSlab {
|
||||
|
||||
public BlockSnowBrickSlab(boolean full) {
|
||||
super(full, 2);
|
||||
super(full, CustomBrickVariant.FROSTY_BRICK);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-1
@@ -11,12 +11,13 @@
|
||||
package vazkii.botania.common.block.decor.slabs.bricks;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import vazkii.botania.api.state.enums.CustomBrickVariant;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
|
||||
public class BlockSoulBrickSlab extends BlockCustomBrickSlab {
|
||||
|
||||
public BlockSoulBrickSlab(boolean full) {
|
||||
super(full, 1);
|
||||
super(full, CustomBrickVariant.SOUL_BRICK);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,12 +11,13 @@
|
||||
package vazkii.botania.common.block.decor.slabs.bricks;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import vazkii.botania.api.state.enums.CustomBrickVariant;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
|
||||
public class BlockTileSlab extends BlockCustomBrickSlab {
|
||||
|
||||
public BlockTileSlab(boolean full) {
|
||||
super(full, 3);
|
||||
super(full, CustomBrickVariant.ROOF_TILE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-1
@@ -1,6 +1,8 @@
|
||||
package vazkii.botania.common.block.decor.slabs.living;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.LivingWoodVariant;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
import vazkii.botania.common.block.decor.slabs.BlockLivingSlab;
|
||||
@@ -8,7 +10,7 @@ import vazkii.botania.common.block.decor.slabs.BlockLivingSlab;
|
||||
public class BlockDreamwoodPlankSlab extends BlockLivingSlab {
|
||||
|
||||
public BlockDreamwoodPlankSlab(boolean full) {
|
||||
super(full, ModBlocks.dreamwood, 1);
|
||||
super(full, ModBlocks.dreamwood.getDefaultState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.PLANKS));
|
||||
setHardness(2.0F);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import vazkii.botania.common.block.decor.slabs.BlockLivingSlab;
|
||||
public class BlockDreamwoodSlab extends BlockLivingSlab {
|
||||
|
||||
public BlockDreamwoodSlab(boolean full) {
|
||||
super(full, ModBlocks.dreamwood, 0);
|
||||
super(full, ModBlocks.dreamwood.getDefaultState());
|
||||
setHardness(2.0F);
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -1,6 +1,8 @@
|
||||
package vazkii.botania.common.block.decor.slabs.living;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.LivingRockVariant;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
import vazkii.botania.common.block.decor.slabs.BlockLivingSlab;
|
||||
@@ -8,7 +10,7 @@ import vazkii.botania.common.block.decor.slabs.BlockLivingSlab;
|
||||
public class BlockLivingrockBrickSlab extends BlockLivingSlab {
|
||||
|
||||
public BlockLivingrockBrickSlab(boolean full) {
|
||||
super(full, ModBlocks.livingrock, 1);
|
||||
super(full, ModBlocks.livingrock.getDefaultState().withProperty(BotaniaStateProps.LIVINGROCK_VARIANT, LivingRockVariant.BRICK));
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import vazkii.botania.common.block.decor.slabs.BlockLivingSlab;
|
||||
public class BlockLivingrockSlab extends BlockLivingSlab {
|
||||
|
||||
public BlockLivingrockSlab(boolean full) {
|
||||
super(full, ModBlocks.livingrock, 0);
|
||||
super(full, ModBlocks.livingrock.getDefaultState());
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
|
||||
+3
-1
@@ -1,6 +1,8 @@
|
||||
package vazkii.botania.common.block.decor.slabs.living;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.LivingWoodVariant;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
import vazkii.botania.common.block.decor.slabs.BlockLivingSlab;
|
||||
@@ -8,7 +10,7 @@ import vazkii.botania.common.block.decor.slabs.BlockLivingSlab;
|
||||
public class BlockLivingwoodPlankSlab extends BlockLivingSlab {
|
||||
|
||||
public BlockLivingwoodPlankSlab(boolean full) {
|
||||
super(full, ModBlocks.livingwood, 1);
|
||||
super(full, ModBlocks.livingwood.getDefaultState().withProperty(BotaniaStateProps.LIVINGWOOD_VARIANT, LivingWoodVariant.PLANKS));
|
||||
setHardness(2.0F);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import vazkii.botania.common.block.decor.slabs.BlockLivingSlab;
|
||||
public class BlockLivingwoodSlab extends BlockLivingSlab {
|
||||
|
||||
public BlockLivingwoodSlab(boolean full) {
|
||||
super(full, ModBlocks.livingwood, 0);
|
||||
super(full, ModBlocks.livingwood.getDefaultState());
|
||||
setHardness(2.0F);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ import vazkii.botania.common.block.decor.slabs.BlockLivingSlab;
|
||||
public class BlockShimmerrockSlab extends BlockLivingSlab {
|
||||
|
||||
public BlockShimmerrockSlab(boolean full) {
|
||||
super(full, ModBlocks.shimmerrock, 0);
|
||||
super(full, ModBlocks.shimmerrock.getDefaultState());
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ import vazkii.botania.common.block.decor.slabs.BlockLivingSlab;
|
||||
public class BlockShimmerwoodPlankSlab extends BlockLivingSlab {
|
||||
|
||||
public BlockShimmerwoodPlankSlab(boolean full) {
|
||||
super(full, ModBlocks.shimmerwoodPlanks, 0);
|
||||
super(full, ModBlocks.shimmerwoodPlanks.getDefaultState());
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeWood);
|
||||
|
||||
+2
-1
@@ -1,12 +1,13 @@
|
||||
package vazkii.botania.common.block.decor.slabs.prismarine;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import vazkii.botania.api.state.enums.PrismarineVariant;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
|
||||
public class BlockDarkPrismarineSlab extends BlockPrismarineSlab {
|
||||
|
||||
public BlockDarkPrismarineSlab(boolean full) {
|
||||
super(full, 2);
|
||||
super(full, PrismarineVariant.DARK_PRIMSARINE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+2
-1
@@ -1,12 +1,13 @@
|
||||
package vazkii.botania.common.block.decor.slabs.prismarine;
|
||||
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import vazkii.botania.api.state.enums.PrismarineVariant;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
|
||||
public class BlockPrismarineBrickSlab extends BlockPrismarineSlab {
|
||||
|
||||
public BlockPrismarineBrickSlab(boolean full) {
|
||||
super(full, 1);
|
||||
super(full, PrismarineVariant.PRISMARINE_BRICKS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+5
-3
@@ -6,6 +6,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.state.BotaniaStateProps;
|
||||
import vazkii.botania.api.state.enums.PrismarineVariant;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
import vazkii.botania.common.block.decor.slabs.BlockLivingSlab;
|
||||
@@ -14,11 +16,11 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
public class BlockPrismarineSlab extends BlockLivingSlab {
|
||||
|
||||
public BlockPrismarineSlab(boolean full) {
|
||||
this(full, 0);
|
||||
this(full, PrismarineVariant.PRISMARINE);
|
||||
}
|
||||
|
||||
public BlockPrismarineSlab(boolean full, int meta) {
|
||||
super(full, ModBlocks.prismarine, meta);
|
||||
public BlockPrismarineSlab(boolean full, PrismarineVariant variant) {
|
||||
super(full, ModBlocks.prismarine.getDefaultState().withProperty(BotaniaStateProps.PRISMARINE_VARIANT, variant));
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.decor.stairs;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
@@ -20,8 +20,8 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
public class BlockBiomeStoneStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockBiomeStoneStairs(Block source, int meta) {
|
||||
super(source, meta);
|
||||
public BlockBiomeStoneStairs(IBlockState state) {
|
||||
super(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,7 +23,7 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
public class BlockPavementStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockPavementStairs(EnumDyeColor color) {
|
||||
super(ModFluffBlocks.pavement.getDefaultState().withProperty(BotaniaStateProps.COLOR, color));
|
||||
super(ModFluffBlocks.pavement.getDefaultState().withProperty(BotaniaStateProps.PAVEMENT_COLOR, color));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,11 +12,14 @@ package vazkii.botania.common.item.relic;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
@@ -31,20 +34,18 @@ public class ItemKingKey extends ItemRelic implements IManaUsingItem {
|
||||
private static final String TAG_CHARGING = "charging";
|
||||
|
||||
private static final int WEAPON_TYPES = 12;
|
||||
// public static IIcon[] weaponIcons;
|
||||
public static TextureAtlasSprite[] weaponIcons;
|
||||
|
||||
public ItemKingKey() {
|
||||
super(LibItemNames.KING_KEY);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void registerIcons(IIconRegister par1IconRegister) {
|
||||
// super.registerIcons(par1IconRegister);
|
||||
//
|
||||
// weaponIcons = new IIcon[WEAPON_TYPES];
|
||||
// for(int i = 0; i < WEAPON_TYPES; i++)
|
||||
// weaponIcons[i] = IconHelper.forName(par1IconRegister, "gateWeapon" + i);
|
||||
// } todo 1.8
|
||||
@SubscribeEvent
|
||||
public void registerIcons(TextureStitchEvent.Pre event) {
|
||||
weaponIcons = new TextureAtlasSprite[WEAPON_TYPES];
|
||||
for(int i = 0; i < WEAPON_TYPES; i++)
|
||||
weaponIcons[i] = IconHelper.forName(event.map, "gateWeapon" + i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||
|
||||
Reference in new issue
Block a user