This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package iamrob.multilink.network.message; | |
import cpw.mods.fml.common.FMLCommonHandler; | |
import cpw.mods.fml.common.network.simpleimpl.IMessage; | |
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; | |
import cpw.mods.fml.common.network.simpleimpl.MessageContext; | |
import iamrob.multilink.item.ItemLinkHolder; | |
import iamrob.multilink.util.LogHelper; | |
import io.netty.buffer.ByteBuf; | |
import net.minecraft.entity.player.EntityPlayer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf8 | |
""" | |
A simple script that commits ALL changes to a repository | |
Copyright © 2014 Dimitri Molenaars <[email protected]> | |
This work is free. You can redistribute it and/or modify it under the | |
terms of the Do What The Fuck You Want To Public License, Version 2, | |
as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PacketHandler implements IPacketHandler { | |
@Override | |
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) { | |
ByteArrayDataInput reader = ByteStreams.newDataInput(packet.data); | |
EntityPlayer entityPlayer = (EntityPlayer) player; | |
byte packetId = reader.readByte(); | |
System.out.println("Packet recieved"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Save data | |
public void updateStackTagCompound(ItemStack itemStack, ItemStack[] values) { | |
if (itemStack.stackTagCompound == null) { | |
itemStack.setTagCompound(new NBTTagCompound()); | |
} | |
NBTTagList list = new NBTTagList(); | |
for (int i = 0; i < values.length; i++) { | |
ItemStack stack = values[i]; | |
NBTTagCompound link = new NBTTagCompound(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//GUI Handler Class | |
public class GuiHandler implements IGuiHandler { | |
public GuiHandler() { | |
NetworkRegistry.instance().registerGuiHandler(MultiLink.instance, this); | |
} | |
@Override | |
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PlayerDamageHistory { | |
private String attacker; | |
private Long time; | |
public PlayerDamageHistory(String attacker, Long time) { | |
this.attacker = attacker; | |
this.time = time; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package untitled.tileentities; | |
import untitled.network.PacketHandler; | |
import net.minecraft.nbt.NBTTagCompound; | |
import net.minecraft.network.INetworkManager; | |
import net.minecraft.network.packet.Packet132TileEntityData; | |
import net.minecraft.tileentity.TileEntity; | |
import net.minecraft.util.MathHelper; | |
import cpw.mods.fml.relauncher.Side; | |
import cpw.mods.fml.relauncher.SideOnly; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package untitled.network; | |
import java.io.ByteArrayOutputStream; | |
import java.io.DataOutputStream; | |
import java.io.IOException; | |
import net.minecraft.entity.player.EntityPlayer; | |
import net.minecraft.network.INetworkManager; | |
import net.minecraft.network.packet.Packet250CustomPayload; | |
import net.minecraft.tileentity.TileEntity; |