mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-22 19:58:34 +01:00
refine this homi fix thing
This commit is contained in:
parent
444aae4bea
commit
713ca2782f
2 changed files with 7 additions and 3 deletions
|
@ -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) {
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue