Grasscutter/src/main/java/emu/grasscutter/server/packet/recv/HandlerHitTreeNotify.java
zhaodice a95002fd40 Hunting and deforestation support. (#1083)
* add drops for animals wild pig,fishes,foxes,birds

* append fox

* Deforestation Support

implement drop woods when attacking tree

* Deforestation support (remove prints)

implement drop woods when attacking tree

* Deforestation support (remove prints)

implement drop woods when attacking tree

* add AutoRecycleHashMap

Map's KEY is automatic expire if key long time no use (query or modify from HashMap)

* use AutoRecycleHashMap in case of memory leak

* fix bug

* remove prints

* static AutoRecycleHashMap

* fix problems

* Delete AutoRecycleHashMap.java

* remove log

* fix build

* improve

* remove unnecessary information

Co-authored-by: Albedo <105265570+arub3do@users.noreply.github.com>

Co-authored-by: Albedo <105265570+arub3do@users.noreply.github.com>
2022-05-29 06:16:49 -07:00

21 lines
756 B
Java

package emu.grasscutter.server.packet.recv;
import java.math.BigInteger;
import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketHandler;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.HitTreeNotifyOuterClass.HitTreeNotify;
import emu.grasscutter.server.game.GameSession;
/**
* Implement Deforestation Function
*/
@Opcodes(PacketOpcodes.HitTreeNotify)
public class HandlerHitTreeNotify extends PacketHandler {
@Override
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
HitTreeNotify hit = HitTreeNotify.parseFrom(payload);
session.getPlayer().getDeforestationManager().onDeforestationInvoke(hit);
}
}