Merge branch 'master' into 1.12
This commit is contained in:
commit
3018400e00
|
|
@ -15,6 +15,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import tschipp.carryon.CarryOn;
|
||||
import tschipp.carryon.common.handler.CustomPickupOverrideHandler;
|
||||
import tschipp.carryon.common.handler.ModelOverridesHandler;
|
||||
|
|
@ -76,7 +77,7 @@ public class CommandCarryOn extends CommandBase implements ICommand
|
|||
cleared += player.inventory.clearMatchingItems(RegistrationHandler.itemTile, 0, 64, null);
|
||||
cleared += player.inventory.clearMatchingItems(RegistrationHandler.itemEntity, 0, 64, null);
|
||||
|
||||
CarryOn.network.sendTo(new CarrySlotPacket(9), (EntityPlayerMP) player);
|
||||
CarryOn.network.sendToAllAround(new CarrySlotPacket(9), new TargetPoint(player.world.provider.getDimension(), player.posX, player.posY, player.posZ, 256));
|
||||
|
||||
if (cleared != 1)
|
||||
player.sendMessage(new TextComponentString("Cleared " + cleared + " Items!"));
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import net.minecraftforge.event.entity.EntityJoinWorldEvent;
|
|||
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event.Result;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
|
|
@ -91,21 +92,21 @@ public class ItemEntityEvents
|
|||
{
|
||||
if (ItemEntity.storeEntityData(entity, world, stack))
|
||||
{
|
||||
if(entity.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null))
|
||||
if (entity.hasCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null))
|
||||
{
|
||||
IItemHandler handler = entity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, null);
|
||||
for(int i = 0; i < handler.getSlots(); i++)
|
||||
for (int i = 0; i < handler.getSlots(); i++)
|
||||
{
|
||||
handler.extractItem(i, 64, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
CarryOnOverride override = ScriptChecker.inspectEntity(entity);
|
||||
int overrideHash = 0;
|
||||
if(override != null)
|
||||
if (override != null)
|
||||
overrideHash = override.hashCode();
|
||||
|
||||
CarryOn.network.sendTo(new CarrySlotPacket(player.inventory.currentItem, overrideHash), (EntityPlayerMP) player);
|
||||
|
||||
CarryOn.network.sendToAllAround(new CarrySlotPacket(player.inventory.currentItem, overrideHash), new TargetPoint(world.provider.getDimension(), player.posX, player.posY, player.posZ, 256));
|
||||
entity.setDead();
|
||||
player.setHeldItem(EnumHand.MAIN_HAND, stack);
|
||||
event.setCanceled(true);
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
|||
import net.minecraftforge.fml.common.eventhandler.Event.Result;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import tschipp.carryon.CarryOn;
|
||||
import tschipp.carryon.client.keybinds.CarryOnKeybinds;
|
||||
import tschipp.carryon.common.handler.ListHandler;
|
||||
import tschipp.carryon.common.handler.PickupHandler;
|
||||
import tschipp.carryon.common.handler.RegistrationHandler;
|
||||
import tschipp.carryon.common.item.ItemTile;
|
||||
|
|
@ -123,7 +123,7 @@ public class ItemEvents
|
|||
|
||||
try
|
||||
{
|
||||
CarryOn.network.sendTo(new CarrySlotPacket(player.inventory.currentItem, overrideHash), (EntityPlayerMP) player);
|
||||
CarryOn.network.sendToAllAround(new CarrySlotPacket(player.inventory.currentItem, overrideHash), new TargetPoint(world.provider.getDimension(), player.posX, player.posY, player.posZ, 256));
|
||||
world.removeTileEntity(pos);
|
||||
world.setBlockToAir(pos);
|
||||
player.setHeldItem(EnumHand.MAIN_HAND, stack);
|
||||
|
|
@ -132,7 +132,7 @@ public class ItemEvents
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
CarryOn.network.sendTo(new CarrySlotPacket(9), (EntityPlayerMP) player);
|
||||
CarryOn.network.sendToAllAround(new CarrySlotPacket(9), new TargetPoint(world.provider.getDimension(), player.posX, player.posY, player.posZ, 256));
|
||||
world.setBlockState(pos, statee);
|
||||
if (!tag.hasNoTags())
|
||||
TileEntity.create(world, tag);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user