refine this homi fix thing

This commit is contained in:
Ellpeck 2020-03-14 13:54:31 +01:00
parent 444aae4bea
commit 713ca2782f
2 changed files with 7 additions and 3 deletions

View file

@ -12,6 +12,7 @@ import de.ellpeck.naturesaura.chunk.AuraChunkProvider;
import de.ellpeck.naturesaura.commands.CommandAura; import de.ellpeck.naturesaura.commands.CommandAura;
import de.ellpeck.naturesaura.misc.WorldData; import de.ellpeck.naturesaura.misc.WorldData;
import de.ellpeck.naturesaura.packet.PacketHandler; import de.ellpeck.naturesaura.packet.PacketHandler;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
@ -57,10 +58,13 @@ public class CommonEvents {
return; return;
ItemStack held = event.getItemStack(); ItemStack held = event.getItemStack();
if (!held.isEmpty() && held.getItem().getRegistryName().getPath().contains("chisel")) { if (!held.isEmpty() && held.getItem().getRegistryName().getPath().contains("chisel")) {
BlockState state = player.world.getBlockState(event.getPos());
if (NaturesAuraAPI.BOTANIST_PICKAXE_CONVERSIONS.containsKey(state)) {
WorldData data = (WorldData) IWorldData.getWorldData(player.world); WorldData data = (WorldData) IWorldData.getWorldData(player.world);
data.addMossStone(event.getPos()); data.addMossStone(event.getPos());
} }
} }
}
@SubscribeEvent @SubscribeEvent
public void onWorldTick(TickEvent.WorldTickEvent event) { public void onWorldTick(TickEvent.WorldTickEvent event) {

View file

@ -93,7 +93,7 @@ public class WorldData implements IWorldData {
public void addMossStone(BlockPos pos) { public void addMossStone(BlockPos pos) {
this.recentlyConvertedMossStones.add(pos); this.recentlyConvertedMossStones.add(pos);
if (this.recentlyConvertedMossStones.size() > 512) if (this.recentlyConvertedMossStones.size() > 2048)
this.recentlyConvertedMossStones.remove(0); this.recentlyConvertedMossStones.remove(0);
} }
} }