Merge branch 'master' into 1.12
This commit is contained in:
commit
77058317cd
|
|
@ -29,7 +29,7 @@ public class CarryOn {
|
||||||
public static CarryOn instance;
|
public static CarryOn instance;
|
||||||
|
|
||||||
public static final String MODID = "carryon";
|
public static final String MODID = "carryon";
|
||||||
public static final String VERSION = "1.4";
|
public static final String VERSION = "1.4.1";
|
||||||
public static final String NAME = "Carry On";
|
public static final String NAME = "Carry On";
|
||||||
public static final String UPDATE_JSON = "https://gist.githubusercontent.com/Tschipp/dccadee7c90d7a34e6e76a35d9d6fa2e/raw/";
|
public static final String UPDATE_JSON = "https://gist.githubusercontent.com/Tschipp/dccadee7c90d7a34e6e76a35d9d6fa2e/raw/";
|
||||||
public static final Logger LOGGER = LogManager.getFormatterLogger("CarryOn");
|
public static final Logger LOGGER = LogManager.getFormatterLogger("CarryOn");
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,10 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.util.text.TextComponentString;
|
||||||
|
import net.minecraft.util.text.TextFormatting;
|
||||||
|
import net.minecraft.util.text.event.ClickEvent;
|
||||||
|
import net.minecraft.util.text.event.ClickEvent.Action;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
|
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
|
||||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||||
|
|
@ -107,18 +111,31 @@ public class ItemEvents
|
||||||
{
|
{
|
||||||
if (ItemTile.storeTileData(te, world, pos, state.getActualState(world, pos), stack))
|
if (ItemTile.storeTileData(te, world, pos, state.getActualState(world, pos), stack))
|
||||||
{
|
{
|
||||||
CarryOn.network.sendTo(new CarrySlotPacket(player.inventory.currentItem), (EntityPlayerMP) player);
|
IBlockState statee = world.getBlockState(pos);
|
||||||
if (world.getTileEntity(pos) != null)
|
NBTTagCompound tag = new NBTTagCompound();
|
||||||
{
|
tag = world.getTileEntity(pos) != null ? world.getTileEntity(pos).writeToNBT(tag) : new NBTTagCompound();
|
||||||
TileEntity newtile = world.getTileEntity(pos).getClass().newInstance();
|
|
||||||
world.removeTileEntity(pos);
|
|
||||||
world.setTileEntity(pos, newtile);
|
|
||||||
}
|
|
||||||
world.setBlockToAir(pos);
|
|
||||||
player.setHeldItem(EnumHand.MAIN_HAND, stack);
|
|
||||||
event.setUseBlock(Result.DENY);
|
|
||||||
event.setCanceled(true);
|
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
CarryOn.network.sendTo(new CarrySlotPacket(player.inventory.currentItem), (EntityPlayerMP) player);
|
||||||
|
world.removeTileEntity(pos);
|
||||||
|
world.setBlockToAir(pos);
|
||||||
|
player.setHeldItem(EnumHand.MAIN_HAND, stack);
|
||||||
|
event.setUseBlock(Result.DENY);
|
||||||
|
event.setCanceled(true);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
CarryOn.network.sendTo(new CarrySlotPacket(9), (EntityPlayerMP) player);
|
||||||
|
world.setBlockState(pos, statee);
|
||||||
|
if (!tag.hasNoTags())
|
||||||
|
TileEntity.create(world, tag);
|
||||||
|
|
||||||
|
player.sendMessage(new TextComponentString(TextFormatting.RED + "Error detected. Cannot pick up block."));
|
||||||
|
TextComponentString s = new TextComponentString(TextFormatting.GOLD + "here");
|
||||||
|
s.getStyle().setClickEvent(new ClickEvent(Action.OPEN_URL, "https://github.com/Tschipp/CarryOn/issues"));
|
||||||
|
player.sendMessage(new TextComponentString(TextFormatting.RED + "Please report this error ").appendSibling(s));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
{
|
{
|
||||||
"modid" : "carryon",
|
"modid" : "carryon",
|
||||||
"name" : "Carry On",
|
"name" : "Carry On",
|
||||||
"version" : "1.4", "mcversion" : "1.12",
|
"version" : "1.4.1", "mcversion" : "1.12",
|
||||||
"url" : "",
|
"url" : "",
|
||||||
"credits" : "Tschipp, Purplicious_Cow, cy4n",
|
"credits" : "Tschipp, Purplicious_Cow, cy4n",
|
||||||
"authorList" : ["Tschipp, Purplicious_Cow, cy4n"],
|
"authorList" : ["Tschipp, Purplicious_Cow, cy4n"],
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user