mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-20 12:09:49 +00:00
Updated to 1.10.2
Removed 1.9 support
This commit is contained in:
1 parent
a7e6f13c60
commit
e5b27c19b7
79 files changed
+194
-180
No files matched your search
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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.mc1102;
|
||||
|
||||
import minetweaker.IPlatformFunctions;
|
||||
import minetweaker.api.chat.IChatMessage;
|
||||
import minetweaker.api.item.IItemDefinition;
|
||||
import minetweaker.mc1102.chat.MCChatMessage;
|
||||
import minetweaker.mc1102.item.MCItemDefinition;
|
||||
import minetweaker.mc1102.network.MineTweakerLoadScriptsPacket;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import static minetweaker.mc1102.MineTweakerMod.NETWORK;
|
||||
|
||||
/**
|
||||
* @author Stan
|
||||
*/
|
||||
public class MCPlatformFunctions implements IPlatformFunctions{
|
||||
public static final MCPlatformFunctions INSTANCE = new MCPlatformFunctions();
|
||||
|
||||
private MCPlatformFunctions(){
|
||||
}
|
||||
|
||||
@Override
|
||||
public IChatMessage getMessage(String message){
|
||||
return new MCChatMessage(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void distributeScripts(byte[] data){
|
||||
NETWORK.sendToAll(new MineTweakerLoadScriptsPacket(data));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemDefinition getItemDefinition(int id){
|
||||
Item item = Item.getItemById(id);
|
||||
if(item == null)
|
||||
return null;
|
||||
ResourceLocation res = Item.REGISTRY.getNameForObject(item);
|
||||
String sid = res.getResourceDomain() + ":" + res.getResourcePath();
|
||||
return new MCItemDefinition(sid, item);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user