mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-18 09:54:59 +01:00
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>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user