Update to 1.11.1
This commit is contained in:
parent
4e30e55f3a
commit
d3fb8efb45
|
|
@ -24,7 +24,7 @@ compileJava {
|
||||||
}
|
}
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
version = "1.12.2-14.23.4.2705"
|
version = "1.12.2-14.23.4.2765"
|
||||||
runDir = "run"
|
runDir = "run"
|
||||||
|
|
||||||
mappings = "snapshot_20171003"
|
mappings = "snapshot_20171003"
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,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.10";
|
public static final String VERSION = "1.11.1";
|
||||||
public static final String NAME = "Carry On";
|
public static final String NAME = "Carry On";
|
||||||
public static final String ACCEPTED_VERSIONS = "[1.12.2,1.13)";
|
public static final String ACCEPTED_VERSIONS = "[1.12.2,1.13)";
|
||||||
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/";
|
||||||
|
|
|
||||||
|
|
@ -557,6 +557,8 @@ public class RenderEvents
|
||||||
{
|
{
|
||||||
renderArmPre(model.bipedRightArm);
|
renderArmPre(model.bipedRightArm);
|
||||||
renderArmPre(model.bipedRightArmwear);
|
renderArmPre(model.bipedRightArmwear);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (renderLeft)
|
if (renderLeft)
|
||||||
|
|
|
||||||
|
|
@ -168,6 +168,8 @@ public class Configs {
|
||||||
"refinedstorage:*",
|
"refinedstorage:*",
|
||||||
"practicallogistics2:*",
|
"practicallogistics2:*",
|
||||||
"mcmultipart:*",
|
"mcmultipart:*",
|
||||||
|
"enderstorage:*",
|
||||||
|
"betterstorage:*"
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,20 +2,19 @@ package tschipp.carryon.common.event;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLiving;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.passive.EntityAnimal;
|
import net.minecraft.entity.passive.EntityAnimal;
|
||||||
import net.minecraft.entity.passive.EntityHorse;
|
import net.minecraft.entity.passive.EntityHorse;
|
||||||
import net.minecraft.entity.passive.EntityVillager;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
import net.minecraft.init.SoundEvents;
|
import net.minecraft.init.SoundEvents;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.EnumActionResult;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.EnumHand;
|
import net.minecraft.util.EnumHand;
|
||||||
import net.minecraft.util.SoundCategory;
|
import net.minecraft.util.SoundCategory;
|
||||||
|
|
@ -27,10 +26,8 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event.Result;
|
import net.minecraftforge.fml.common.eventhandler.Event.Result;
|
||||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.common.network.NetworkRegistry.TargetPoint;
|
|
||||||
import net.minecraftforge.items.CapabilityItemHandler;
|
import net.minecraftforge.items.CapabilityItemHandler;
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
import tschipp.carryon.CarryOn;
|
|
||||||
import tschipp.carryon.client.keybinds.CarryOnKeybinds;
|
import tschipp.carryon.client.keybinds.CarryOnKeybinds;
|
||||||
import tschipp.carryon.common.config.CarryOnConfig;
|
import tschipp.carryon.common.config.CarryOnConfig;
|
||||||
import tschipp.carryon.common.handler.PickupHandler;
|
import tschipp.carryon.common.handler.PickupHandler;
|
||||||
|
|
@ -38,7 +35,6 @@ import tschipp.carryon.common.handler.RegistrationHandler;
|
||||||
import tschipp.carryon.common.item.ItemEntity;
|
import tschipp.carryon.common.item.ItemEntity;
|
||||||
import tschipp.carryon.common.scripting.CarryOnOverride;
|
import tschipp.carryon.common.scripting.CarryOnOverride;
|
||||||
import tschipp.carryon.common.scripting.ScriptChecker;
|
import tschipp.carryon.common.scripting.ScriptChecker;
|
||||||
import tschipp.carryon.network.client.CarrySlotPacket;
|
|
||||||
|
|
||||||
public class ItemEntityEvents
|
public class ItemEntityEvents
|
||||||
{
|
{
|
||||||
|
|
@ -53,7 +49,6 @@ public class ItemEntityEvents
|
||||||
player.getEntityData().removeTag("carrySlot");
|
player.getEntityData().removeTag("carrySlot");
|
||||||
event.setUseBlock(Result.DENY);
|
event.setUseBlock(Result.DENY);
|
||||||
|
|
||||||
|
|
||||||
if (!player.world.isRemote)
|
if (!player.world.isRemote)
|
||||||
{
|
{
|
||||||
CarryOnOverride override = ScriptChecker.getOverride(player);
|
CarryOnOverride override = ScriptChecker.getOverride(player);
|
||||||
|
|
@ -132,9 +127,14 @@ public class ItemEntityEvents
|
||||||
overrideHash = override.hashCode();
|
overrideHash = override.hashCode();
|
||||||
|
|
||||||
ItemEvents.sendPacket(player, player.inventory.currentItem, overrideHash);
|
ItemEvents.sendPacket(player, player.inventory.currentItem, overrideHash);
|
||||||
|
|
||||||
|
if (entity instanceof EntityLiving)
|
||||||
|
((EntityLiving) entity).setHealth(0);
|
||||||
|
|
||||||
entity.setDead();
|
entity.setDead();
|
||||||
player.setHeldItem(EnumHand.MAIN_HAND, stack);
|
player.setHeldItem(EnumHand.MAIN_HAND, stack);
|
||||||
event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
|
event.setCancellationResult(EnumActionResult.FAIL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
package tschipp.carryon.common.event;
|
package tschipp.carryon.common.event;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
|
@ -7,6 +11,7 @@ import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.EntityPlayerMP;
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
@ -30,10 +35,12 @@ import net.minecraftforge.event.entity.player.PlayerEvent.BreakSpeed;
|
||||||
import net.minecraftforge.event.entity.player.PlayerEvent.StartTracking;
|
import net.minecraftforge.event.entity.player.PlayerEvent.StartTracking;
|
||||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||||
import net.minecraftforge.event.world.BlockEvent.BreakEvent;
|
import net.minecraftforge.event.world.BlockEvent.BreakEvent;
|
||||||
|
import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent;
|
||||||
import net.minecraftforge.fml.common.eventhandler.Event.Result;
|
import net.minecraftforge.fml.common.eventhandler.Event.Result;
|
||||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||||
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
|
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
|
||||||
|
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||||
import net.minecraftforge.fml.common.network.NetworkRegistry.TargetPoint;
|
import net.minecraftforge.fml.common.network.NetworkRegistry.TargetPoint;
|
||||||
import net.minecraftforge.items.CapabilityItemHandler;
|
import net.minecraftforge.items.CapabilityItemHandler;
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
|
|
@ -47,11 +54,12 @@ import tschipp.carryon.common.item.ItemTile;
|
||||||
import tschipp.carryon.common.scripting.CarryOnOverride;
|
import tschipp.carryon.common.scripting.CarryOnOverride;
|
||||||
import tschipp.carryon.common.scripting.ScriptChecker;
|
import tschipp.carryon.common.scripting.ScriptChecker;
|
||||||
import tschipp.carryon.network.client.CarrySlotPacket;
|
import tschipp.carryon.network.client.CarrySlotPacket;
|
||||||
import tschipp.carryon.network.server.SyncKeybindPacket;
|
|
||||||
|
|
||||||
public class ItemEvents
|
public class ItemEvents
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public static Map<BlockPos, Integer> positions = new HashMap<BlockPos, Integer>();
|
||||||
|
|
||||||
@SubscribeEvent(priority = EventPriority.HIGH)
|
@SubscribeEvent(priority = EventPriority.HIGH)
|
||||||
public void onBlockClick(PlayerInteractEvent.RightClickBlock event)
|
public void onBlockClick(PlayerInteractEvent.RightClickBlock event)
|
||||||
{
|
{
|
||||||
|
|
@ -65,7 +73,6 @@ public class ItemEvents
|
||||||
player.getEntityData().removeTag("carrySlot");
|
player.getEntityData().removeTag("carrySlot");
|
||||||
event.setUseBlock(Result.DENY);
|
event.setUseBlock(Result.DENY);
|
||||||
|
|
||||||
|
|
||||||
if (!player.world.isRemote)
|
if (!player.world.isRemote)
|
||||||
{
|
{
|
||||||
CarryOnOverride override = ScriptChecker.getOverride(player);
|
CarryOnOverride override = ScriptChecker.getOverride(player);
|
||||||
|
|
@ -117,6 +124,13 @@ public class ItemEvents
|
||||||
ItemTile.clearTileData(stack);
|
ItemTile.clearTileData(stack);
|
||||||
eitem.setItem(ItemStack.EMPTY);
|
eitem.setItem(ItemStack.EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BlockPos pos = new BlockPos(Math.floor(eitem.posX), Math.floor(eitem.posY), Math.floor(eitem.posZ));
|
||||||
|
if(positions.containsKey(pos))
|
||||||
|
{
|
||||||
|
event.setCanceled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -245,8 +259,30 @@ public class ItemEvents
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onBlockRightClick(PlayerInteractEvent.RightClickBlock event) throws InstantiationException, IllegalAccessException
|
public void onWorldTick(TickEvent.WorldTickEvent event)
|
||||||
|
{
|
||||||
|
for(Entry<BlockPos, Integer> entry : positions.entrySet())
|
||||||
|
{
|
||||||
|
entry.setValue(entry.getValue() + 1);
|
||||||
|
|
||||||
|
if(entry.getValue() > 3)
|
||||||
|
positions.remove(entry.getKey());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onDrop(HarvestDropsEvent event)
|
||||||
|
{
|
||||||
|
if(positions.containsKey(event.getPos()))
|
||||||
|
{
|
||||||
|
event.getDrops().clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public void onBlockRightClick(PlayerInteractEvent.RightClickBlock event)
|
||||||
{
|
{
|
||||||
EntityPlayer player = event.getEntityPlayer();
|
EntityPlayer player = event.getEntityPlayer();
|
||||||
|
|
||||||
|
|
@ -270,6 +306,7 @@ public class ItemEvents
|
||||||
{
|
{
|
||||||
player.closeScreen();
|
player.closeScreen();
|
||||||
|
|
||||||
|
|
||||||
if (ItemTile.storeTileData(te, world, pos, state.getActualState(world, pos), stack))
|
if (ItemTile.storeTileData(te, world, pos, state.getActualState(world, pos), stack))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -281,15 +318,19 @@ public class ItemEvents
|
||||||
if (override != null)
|
if (override != null)
|
||||||
overrideHash = override.hashCode();
|
overrideHash = override.hashCode();
|
||||||
|
|
||||||
|
positions.put(pos, 0);
|
||||||
|
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
sendPacket(player, player.inventory.currentItem, overrideHash);
|
sendPacket(player, player.inventory.currentItem, overrideHash);
|
||||||
|
|
||||||
world.removeTileEntity(pos);
|
world.removeTileEntity(pos);
|
||||||
world.setBlockToAir(pos);
|
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 3);
|
||||||
player.setHeldItem(EnumHand.MAIN_HAND, stack);
|
player.setHeldItem(EnumHand.MAIN_HAND, stack);
|
||||||
event.setUseBlock(Result.DENY);
|
event.setUseBlock(Result.DENY);
|
||||||
|
event.setUseItem(Result.DENY);
|
||||||
event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
|
|
@ -302,6 +343,7 @@ public class ItemEvents
|
||||||
world.setBlockToAir(pos);
|
world.setBlockToAir(pos);
|
||||||
player.setHeldItem(EnumHand.MAIN_HAND, stack);
|
player.setHeldItem(EnumHand.MAIN_HAND, stack);
|
||||||
event.setUseBlock(Result.DENY);
|
event.setUseBlock(Result.DENY);
|
||||||
|
event.setUseItem(Result.DENY);
|
||||||
event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
|
|
@ -327,6 +369,7 @@ public class ItemEvents
|
||||||
player.getServer().getCommandManager().executeCommand(player.getServer(), "/execute " + player.getGameProfile().getName() + " ~ ~ ~ " + command);
|
player.getServer().getCommandManager().executeCommand(player.getServer(), "/execute " + player.getGameProfile().getName() + " ~ ~ ~ " + command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -335,7 +378,7 @@ public class ItemEvents
|
||||||
|
|
||||||
public static void emptyTileEntity(TileEntity te)
|
public static void emptyTileEntity(TileEntity te)
|
||||||
{
|
{
|
||||||
if (te != null && !te.isInvalid())
|
if (te != null)
|
||||||
{
|
{
|
||||||
for (EnumFacing facing : EnumFacing.VALUES)
|
for (EnumFacing facing : EnumFacing.VALUES)
|
||||||
{
|
{
|
||||||
|
|
@ -372,6 +415,8 @@ public class ItemEvents
|
||||||
itemHandler.extractItem(i, 64, false);
|
itemHandler.extractItem(i, 64, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
te.markDirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
{
|
{
|
||||||
"modid" : "carryon",
|
"modid" : "carryon",
|
||||||
"name" : "Carry On",
|
"name" : "Carry On",
|
||||||
"version" : "1.10", "mcversion" : "1.12.2",
|
"version" : "1.11.1", "mcversion" : "1.12.2",
|
||||||
"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