Update to 1.11.1
This commit is contained in:
parent
4e30e55f3a
commit
d3fb8efb45
|
|
@ -24,7 +24,7 @@ compileJava {
|
|||
}
|
||||
|
||||
minecraft {
|
||||
version = "1.12.2-14.23.4.2705"
|
||||
version = "1.12.2-14.23.4.2765"
|
||||
runDir = "run"
|
||||
|
||||
mappings = "snapshot_20171003"
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class CarryOn {
|
|||
public static CarryOn instance;
|
||||
|
||||
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 ACCEPTED_VERSIONS = "[1.12.2,1.13)";
|
||||
public static final String UPDATE_JSON = "https://gist.githubusercontent.com/Tschipp/dccadee7c90d7a34e6e76a35d9d6fa2e/raw/";
|
||||
|
|
|
|||
|
|
@ -546,7 +546,7 @@ public class RenderEvents
|
|||
if (!stack.isEmpty() && stack.getItem() == RegistrationHandler.itemTile && ItemTile.hasTileData(stack) || stack.getItem() == RegistrationHandler.itemEntity && ItemEntity.hasEntityData(stack))
|
||||
{
|
||||
ModelPlayer model = event.getRenderer().getMainModel();
|
||||
|
||||
|
||||
CarryOnOverride overrider = ScriptChecker.getOverride(player);
|
||||
if (overrider != null)
|
||||
{
|
||||
|
|
@ -557,6 +557,8 @@ public class RenderEvents
|
|||
{
|
||||
renderArmPre(model.bipedRightArm);
|
||||
renderArmPre(model.bipedRightArmwear);
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (renderLeft)
|
||||
|
|
|
|||
|
|
@ -168,6 +168,8 @@ public class Configs {
|
|||
"refinedstorage:*",
|
||||
"practicallogistics2:*",
|
||||
"mcmultipart:*",
|
||||
"enderstorage:*",
|
||||
"betterstorage:*"
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2,20 +2,19 @@ package tschipp.carryon.common.event;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
import net.minecraft.entity.passive.EntityHorse;
|
||||
import net.minecraft.entity.passive.EntityVillager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
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.EventPriority;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import tschipp.carryon.CarryOn;
|
||||
import tschipp.carryon.client.keybinds.CarryOnKeybinds;
|
||||
import tschipp.carryon.common.config.CarryOnConfig;
|
||||
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.scripting.CarryOnOverride;
|
||||
import tschipp.carryon.common.scripting.ScriptChecker;
|
||||
import tschipp.carryon.network.client.CarrySlotPacket;
|
||||
|
||||
public class ItemEntityEvents
|
||||
{
|
||||
|
|
@ -53,7 +49,6 @@ public class ItemEntityEvents
|
|||
player.getEntityData().removeTag("carrySlot");
|
||||
event.setUseBlock(Result.DENY);
|
||||
|
||||
|
||||
if (!player.world.isRemote)
|
||||
{
|
||||
CarryOnOverride override = ScriptChecker.getOverride(player);
|
||||
|
|
@ -132,9 +127,14 @@ public class ItemEntityEvents
|
|||
overrideHash = override.hashCode();
|
||||
|
||||
ItemEvents.sendPacket(player, player.inventory.currentItem, overrideHash);
|
||||
|
||||
if (entity instanceof EntityLiving)
|
||||
((EntityLiving) entity).setHealth(0);
|
||||
|
||||
entity.setDead();
|
||||
player.setHeldItem(EnumHand.MAIN_HAND, stack);
|
||||
event.setCanceled(true);
|
||||
event.setCancellationResult(EnumActionResult.FAIL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
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.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
|
@ -7,6 +11,7 @@ import net.minecraft.entity.EntityLivingBase;
|
|||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
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.PlayerInteractEvent;
|
||||
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.EventPriority;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
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.items.CapabilityItemHandler;
|
||||
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.ScriptChecker;
|
||||
import tschipp.carryon.network.client.CarrySlotPacket;
|
||||
import tschipp.carryon.network.server.SyncKeybindPacket;
|
||||
|
||||
public class ItemEvents
|
||||
{
|
||||
|
||||
public static Map<BlockPos, Integer> positions = new HashMap<BlockPos, Integer>();
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.HIGH)
|
||||
public void onBlockClick(PlayerInteractEvent.RightClickBlock event)
|
||||
{
|
||||
|
|
@ -65,7 +73,6 @@ public class ItemEvents
|
|||
player.getEntityData().removeTag("carrySlot");
|
||||
event.setUseBlock(Result.DENY);
|
||||
|
||||
|
||||
if (!player.world.isRemote)
|
||||
{
|
||||
CarryOnOverride override = ScriptChecker.getOverride(player);
|
||||
|
|
@ -117,6 +124,13 @@ public class ItemEvents
|
|||
ItemTile.clearTileData(stack);
|
||||
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
|
||||
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();
|
||||
|
||||
|
|
@ -270,6 +306,7 @@ public class ItemEvents
|
|||
{
|
||||
player.closeScreen();
|
||||
|
||||
|
||||
if (ItemTile.storeTileData(te, world, pos, state.getActualState(world, pos), stack))
|
||||
{
|
||||
|
||||
|
|
@ -281,15 +318,19 @@ public class ItemEvents
|
|||
if (override != null)
|
||||
overrideHash = override.hashCode();
|
||||
|
||||
positions.put(pos, 0);
|
||||
|
||||
boolean success = false;
|
||||
|
||||
try
|
||||
{
|
||||
sendPacket(player, player.inventory.currentItem, overrideHash);
|
||||
|
||||
world.removeTileEntity(pos);
|
||||
world.setBlockToAir(pos);
|
||||
world.setBlockState(pos, Blocks.AIR.getDefaultState(), 3);
|
||||
player.setHeldItem(EnumHand.MAIN_HAND, stack);
|
||||
event.setUseBlock(Result.DENY);
|
||||
event.setUseItem(Result.DENY);
|
||||
event.setCanceled(true);
|
||||
success = true;
|
||||
}
|
||||
|
|
@ -302,6 +343,7 @@ public class ItemEvents
|
|||
world.setBlockToAir(pos);
|
||||
player.setHeldItem(EnumHand.MAIN_HAND, stack);
|
||||
event.setUseBlock(Result.DENY);
|
||||
event.setUseItem(Result.DENY);
|
||||
event.setCanceled(true);
|
||||
success = true;
|
||||
}
|
||||
|
|
@ -326,6 +368,7 @@ public class ItemEvents
|
|||
if (command != null)
|
||||
player.getServer().getCommandManager().executeCommand(player.getServer(), "/execute " + player.getGameProfile().getName() + " ~ ~ ~ " + command);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -335,7 +378,7 @@ public class ItemEvents
|
|||
|
||||
public static void emptyTileEntity(TileEntity te)
|
||||
{
|
||||
if (te != null && !te.isInvalid())
|
||||
if (te != null)
|
||||
{
|
||||
for (EnumFacing facing : EnumFacing.VALUES)
|
||||
{
|
||||
|
|
@ -372,6 +415,8 @@ public class ItemEvents
|
|||
itemHandler.extractItem(i, 64, false);
|
||||
}
|
||||
}
|
||||
|
||||
te.markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
{
|
||||
"modid" : "carryon",
|
||||
"name" : "Carry On",
|
||||
"version" : "1.10", "mcversion" : "1.12.2",
|
||||
"version" : "1.11.1", "mcversion" : "1.12.2",
|
||||
"url" : "",
|
||||
"credits" : "Tschipp, Purplicious_Cow, cy4n",
|
||||
"authorList" : ["Tschipp, Purplicious_Cow, cy4n"],
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user