mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-27 23:33:10 +00:00
- Added 1.6.4 port
- Fixed /mt name command - Renames MC17 to MC172, in preparation of the 1.7.10 port
This commit is contained in:
1 parent
0c535134c5
commit
db900d3b60
126 files changed
+4880
-57
No files matched your search
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.mc164.network;
|
||||
|
||||
import net.minecraft.network.INetworkManager;
|
||||
import net.minecraft.network.packet.Packet250CustomPayload;
|
||||
import cpw.mods.fml.common.network.IPacketHandler;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.runtime.providers.ScriptProviderMemory;
|
||||
|
||||
public class MCPacketHandler implements IPacketHandler {
|
||||
public static final String CHANNEL_SERVERSCRIPT = "MTServerScript";
|
||||
|
||||
@Override
|
||||
public void onPacketData(INetworkManager manager,
|
||||
Packet250CustomPayload packet, Player player) {
|
||||
// catches some special cases caused by unknown reasons
|
||||
if (packet == null || packet.channel == null || packet.data == null) return;
|
||||
|
||||
if (packet.channel.equals(CHANNEL_SERVERSCRIPT)) {
|
||||
MineTweakerAPI.tweaker.setScriptProvider(new ScriptProviderMemory(packet.data));
|
||||
MineTweakerAPI.tweaker.rollback();
|
||||
MineTweakerAPI.tweaker.load();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user