mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-20 04:09:40 +00:00
Petal apothecaries fully restored
This commit is contained in:
1 parent
71607ae3bd
commit
1973779897
107 files changed
+128
-226
No files matched your search
@@ -69,7 +69,6 @@ public class BotaniaStateProps {
|
||||
|
||||
// BlockAltar
|
||||
public static final PropertyEnum<AltarVariant> ALTAR_VARIANT = PropertyEnum.create("variant", AltarVariant.class);
|
||||
public static final PropertyBool MOSSY = PropertyBool.create("mossy");
|
||||
|
||||
// BlockAltGrass
|
||||
public static final PropertyEnum<AltGrassVariant> ALTGRASS_VARIANT = PropertyEnum.create("variant", AltGrassVariant.class);
|
||||
|
||||
@@ -13,7 +13,8 @@ public enum AltarVariant implements IStringSerializable {
|
||||
SWAMP,
|
||||
DESERT,
|
||||
TAIGA,
|
||||
MESA;
|
||||
MESA,
|
||||
MOSSY;
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
|
||||
@@ -824,8 +824,8 @@ public final class ModelHandler {
|
||||
private static void registerAltars() {
|
||||
Item item = Item.getItemFromBlock(ModBlocks.altar);
|
||||
String name = GameData.getBlockRegistry().getNameForObject(ModBlocks.altar).toString();
|
||||
for (int i = 0; i < AltarVariant.values().length; i++) {
|
||||
String variantName = "mossy=false,variant=" + AltarVariant.values()[i].getName();
|
||||
for (int i = 0; i < AltarVariant.values().length - 1; i++) { // Off by one on purpose to exclude MOSSY
|
||||
String variantName = "variant=" + AltarVariant.values()[i].getName();
|
||||
ModelLoader.registerItemVariants(item, new ModelResourceLocation(name, variantName));
|
||||
ModelLoader.setCustomModelResourceLocation(item, i, new ModelResourceLocation(name, variantName));
|
||||
}
|
||||
|
||||
@@ -64,11 +64,11 @@ public class RenderTileAltar extends TileEntitySpecialRenderer {
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.enableRescaleNormal();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(altar.isMossy ? textureMossy : textures[Math.min(textures.length - 1, forceMeta == -1 ? tileentity.getBlockMetadata() : forceMeta)]);
|
||||
// Minecraft.getMinecraft().renderEngine.bindTexture(altar.isMossy ? textureMossy : textures[Math.min(textures.length - 1, forceMeta == -1 ? tileentity.getBlockMetadata() : forceMeta)]);
|
||||
|
||||
GlStateManager.translate(d0 + 0.5, d1 + 1.5, d2 + 0.5);
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
model.render();
|
||||
// model.render();
|
||||
GlStateManager.scale(1F, -1F, -1F);
|
||||
GlStateManager.enableRescaleNormal();
|
||||
|
||||
|
||||
@@ -68,14 +68,13 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
random = new Random();
|
||||
|
||||
setDefaultState(blockState.getBaseState()
|
||||
.withProperty(BotaniaStateProps.MOSSY, false)
|
||||
.withProperty(BotaniaStateProps.ALTAR_VARIANT, AltarVariant.DEFAULT)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState createBlockState() {
|
||||
return new BlockState(this, BotaniaStateProps.ALTAR_VARIANT, BotaniaStateProps.MOSSY);
|
||||
return new BlockState(this, BotaniaStateProps.ALTAR_VARIANT);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -85,9 +84,10 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
if (meta < 0 || meta >= AltarVariant.values().length) {
|
||||
if (meta < 0 || meta >= AltarVariant.values().length ) {
|
||||
meta = 0;
|
||||
}
|
||||
System.out.println(AltarVariant.values()[meta]);
|
||||
return getDefaultState().withProperty(BotaniaStateProps.ALTAR_VARIANT, AltarVariant.values()[meta]);
|
||||
}
|
||||
|
||||
@@ -98,15 +98,15 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
TileAltar altar = ((TileAltar) te);
|
||||
|
||||
if (altar.isMossy) {
|
||||
state = state.withProperty(BotaniaStateProps.MOSSY, true);
|
||||
state = state.withProperty(BotaniaStateProps.ALTAR_VARIANT, AltarVariant.MOSSY);
|
||||
}
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 2;
|
||||
public EnumWorldBlockLayer getBlockLayer() {
|
||||
return EnumWorldBlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -145,7 +145,6 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
|
||||
public boolean onBlockActivated(World par1World, BlockPos pos, IBlockState state, EntityPlayer par5EntityPlayer, EnumFacing par6, float par7, float par8, float par9) {
|
||||
ItemStack stack = par5EntityPlayer.getCurrentEquippedItem();
|
||||
TileAltar tile = (TileAltar) par1World.getTileEntity(pos);
|
||||
|
||||
if(par5EntityPlayer.isSneaking()) {
|
||||
for(int i = tile.getSizeInventory() - 1; i >= 0; i--) {
|
||||
ItemStack stackAt = tile.getStackInSlot(i);
|
||||
|
||||
@@ -68,13 +68,17 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I
|
||||
return false;
|
||||
|
||||
if(!isMossy && getBlockMetadata() == 0) {
|
||||
if(stack.getItem() == Item.getItemFromBlock(Blocks.vine) && !worldObj.isRemote) {
|
||||
if(stack.getItem() == Item.getItemFromBlock(Blocks.vine)) {
|
||||
isMossy = true;
|
||||
worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock());
|
||||
stack.stackSize--;
|
||||
if(stack.stackSize == 0)
|
||||
item.setDead();
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos);
|
||||
if (worldObj.isRemote) {
|
||||
worldObj.markBlockRangeForRenderUpdate(getPos(), getPos());
|
||||
} else {
|
||||
worldObj.updateComparatorOutputLevel(pos, worldObj.getBlockState(pos).getBlock());
|
||||
stack.stackSize--;
|
||||
if(stack.stackSize == 0)
|
||||
item.setDead();
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user