Fix static model flowers not showing pasture seed effects on apply

This commit is contained in:
Hubry committed 2019-02-12 20:13:28 +01:00
1 parent 9df180a6a1
commit 2986240b74
2 files changed
+24 -2

No files matched your search

@@ -13,6 +13,8 @@ package vazkii.botania.common.block.tile;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import vazkii.botania.api.item.IFloatingFlower;
import vazkii.botania.api.state.BotaniaStateProps;
import vazkii.botania.common.block.ModBlocks;
@@ -21,7 +23,7 @@ public class TileFloatingFlower extends TileMod implements IFloatingFlower {
public static final String TAG_ISLAND_TYPE = "islandType";
public static ItemStack forcedStack = ItemStack.EMPTY;
IslandType type = IslandType.GRASS;
private IslandType type = IslandType.GRASS;
@Override
public ItemStack getDisplayStack() {
@@ -35,6 +37,15 @@ public class TileFloatingFlower extends TileMod implements IFloatingFlower {
return new ItemStack(ModBlocks.shinyFlower, 1, color.getMetadata());
}
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
IslandType oldType = getIslandType();
super.onDataPacket(net, packet);
if(oldType != getIslandType()) {
world.markBlockRangeForRenderUpdate(pos, pos);
}
}
@Override
public IslandType getIslandType() {
return type;
@@ -12,13 +12,15 @@ package vazkii.botania.common.block.tile;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import vazkii.botania.api.item.IFloatingFlower;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
public class TileFloatingSpecialFlower extends TileSpecialFlower implements IFloatingFlower {
public static final String TAG_ISLAND_TYPE = "islandType";
IslandType type = IslandType.GRASS;
private IslandType type = IslandType.GRASS;
@Override
public boolean isOnSpecialSoil() {
@@ -46,6 +48,15 @@ public class TileFloatingSpecialFlower extends TileSpecialFlower implements IFlo
cmp.setString(TAG_ISLAND_TYPE, type.toString());
}
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
IslandType oldType = getIslandType();
super.onDataPacket(net, packet);
if(oldType != getIslandType()) {
world.markBlockRangeForRenderUpdate(pos, pos);
}
}
@Override
public void readPacketNBT(NBTTagCompound cmp) {
super.readPacketNBT(cmp);