Update for 1.10
This commit is contained in:
commit
8436abe222
14
docs/issue_template.md
Normal file
14
docs/issue_template.md
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
### Expected Behavior
|
||||
|
||||
|
||||
### Actual Behavior
|
||||
|
||||
|
||||
### Steps to Reproduce
|
||||
|
||||
|
||||
### Version of Minecraft, Carry On, Forge
|
||||
|
||||
|
||||
### Screenshots encouraged
|
||||
|
|
@ -34,7 +34,7 @@ public class CarryOn {
|
|||
public static CarryOn instance;
|
||||
|
||||
public static final String MODID = "carryon";
|
||||
public static final String VERSION = "1.7";
|
||||
public static final String VERSION = "1.7.1";
|
||||
public static final String NAME = "Carry On";
|
||||
public static final String ACCEPTED_VERSIONS = "[1.10,1.11)";
|
||||
public static final String UPDATE_JSON = "https://gist.githubusercontent.com/Tschipp/dccadee7c90d7a34e6e76a35d9d6fa2e/raw/";
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ import net.minecraft.client.renderer.OpenGlHelper;
|
|||
import net.minecraft.client.renderer.block.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.resources.DefaultPlayerSkin;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
|
|
@ -29,11 +31,13 @@ import net.minecraft.util.EnumHand;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.GuiOpenEvent;
|
||||
import net.minecraftforge.client.event.MouseEvent;
|
||||
import net.minecraftforge.client.event.RenderHandEvent;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
import net.minecraftforge.client.event.RenderWorldLastEvent;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.InputEvent;
|
||||
|
|
@ -179,12 +183,13 @@ public class RenderEvents
|
|||
AbstractClientPlayer aplayer = (AbstractClientPlayer) player;
|
||||
ItemStack stack = player.getHeldItemMainhand();
|
||||
int perspective = Minecraft.getMinecraft().gameSettings.thirdPersonView;
|
||||
|
||||
if (stack != null ? stack.getItem() == RegistrationHandler.itemTile && ItemTile.hasTileData(stack) : false)
|
||||
boolean f1 = Minecraft.getMinecraft().gameSettings.hideGUI;
|
||||
|
||||
if ((stack != null ? stack.getItem() == RegistrationHandler.itemTile && ItemTile.hasTileData(stack) : false) && !f1 && perspective == 0)
|
||||
{
|
||||
if(Loader.isModLoaded("realrender") || Loader.isModLoaded("rfpr"))
|
||||
if (Loader.isModLoaded("realrender") || Loader.isModLoaded("rfpr"))
|
||||
return;
|
||||
|
||||
|
||||
Block block = ItemTile.getBlock(stack);
|
||||
NBTTagCompound tag = ItemTile.getTileData(stack);
|
||||
IBlockState state = ItemTile.getBlockState(stack);
|
||||
|
|
@ -204,9 +209,7 @@ public class RenderEvents
|
|||
GlStateManager.rotate(8, 1f, 0, 0);
|
||||
}
|
||||
|
||||
if (perspective == 0)
|
||||
{
|
||||
IBakedModel model = ModelOverridesHandler.hasCustomOverrideModel(state, tag) ? ModelOverridesHandler.getCustomOverrideModel(state, tag, world, player) : Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides(tileStack == null ? stack : tileStack, world, player);
|
||||
IBakedModel model = ModelOverridesHandler.hasCustomOverrideModel(state, tag) ? ModelOverridesHandler.getCustomOverrideModel(state, tag, world, player) : Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides(tileStack, world, player);
|
||||
|
||||
CarryOnOverride carryOverride = ScriptChecker.getOverride(player);
|
||||
if (carryOverride != null)
|
||||
|
|
@ -237,6 +240,8 @@ public class RenderEvents
|
|||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.setLightmapDisabled(false);
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
||||
|
||||
if (ModelOverridesHandler.hasCustomOverrideModel(state, tag))
|
||||
{
|
||||
Object override = ModelOverridesHandler.getOverrideObject(state, tag);
|
||||
|
|
@ -255,14 +260,14 @@ public class RenderEvents
|
|||
{
|
||||
Minecraft.getMinecraft().getRenderItem().renderItem(tileStack == null ? stack : tileStack, model);
|
||||
}
|
||||
|
||||
|
||||
this.setLightmapDisabled(true);
|
||||
|
||||
if (perspective == 0)
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GlStateManager.scale(1, 1, 1);
|
||||
GlStateManager.popMatrix();
|
||||
|
|
@ -285,6 +290,7 @@ public class RenderEvents
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private int getBrightnessForRender(EntityPlayer player)
|
||||
{
|
||||
|
|
@ -356,19 +362,18 @@ public class RenderEvents
|
|||
GlStateManager.translate(xOffset, yOffset, zOffset);
|
||||
GlStateManager.scale(0.6, 0.6, 0.6);
|
||||
|
||||
|
||||
if (CarryOnConfig.settings.facePlayer ? !isChest(block) : isChest(block))
|
||||
{
|
||||
GlStateManager.rotate(rotation, 0, 1.0f, 0);
|
||||
GlStateManager.translate(0, 1.6, 0.65);
|
||||
if((Loader.isModLoaded("realrender") || Loader.isModLoaded("rfpr")) && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0)
|
||||
if ((Loader.isModLoaded("realrender") || Loader.isModLoaded("rfpr")) && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0)
|
||||
GlStateManager.translate(0, 0, -0.4);
|
||||
}
|
||||
else
|
||||
{
|
||||
GlStateManager.rotate(rotation + 180, 0, 1.0f, 0);
|
||||
GlStateManager.translate(0, 1.6, -0.65);
|
||||
if((Loader.isModLoaded("realrender") || Loader.isModLoaded("rfpr")) && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0)
|
||||
if ((Loader.isModLoaded("realrender") || Loader.isModLoaded("rfpr")) && Minecraft.getMinecraft().gameSettings.thirdPersonView == 0)
|
||||
GlStateManager.translate(0, 0, 0.4);
|
||||
}
|
||||
|
||||
|
|
@ -401,6 +406,8 @@ public class RenderEvents
|
|||
|
||||
}
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
|
||||
|
||||
if (ModelOverridesHandler.hasCustomOverrideModel(state, tag))
|
||||
{
|
||||
Object override = ModelOverridesHandler.getOverrideObject(state, tag);
|
||||
|
|
@ -502,7 +509,7 @@ public class RenderEvents
|
|||
this.fakeLeftArmwear.isHidden = false;
|
||||
this.fakeRightArm.isHidden = false;
|
||||
this.fakeRightArmwear.isHidden = false;
|
||||
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(skinLoc);
|
||||
|
||||
if (aplayer.getSkinType().equals("default"))
|
||||
|
|
@ -546,7 +553,6 @@ public class RenderEvents
|
|||
model.bipedRightArm.isHidden = false;
|
||||
model.bipedRightArmwear.isHidden = false;
|
||||
}
|
||||
|
||||
|
||||
if (!renderLeft)
|
||||
{
|
||||
|
|
@ -555,7 +561,6 @@ public class RenderEvents
|
|||
model.bipedLeftArm.isHidden = false;
|
||||
model.bipedLeftArmwear.isHidden = false;
|
||||
}
|
||||
|
||||
|
||||
if (rotLeft != null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -55,6 +55,12 @@ public class Configs {
|
|||
@Comment("Use Whitelist instead of Blacklist for Entities")
|
||||
public boolean useWhitelistEntities=false;
|
||||
|
||||
@Comment("Whether the player can hit blocks and entities while carrying or not")
|
||||
public boolean hitWhileCarrying=false;
|
||||
|
||||
@Comment("Whether the player drops the carried object when hit or not")
|
||||
public boolean dropCarriedWhenHit=false;
|
||||
|
||||
@Comment("Use custom Pickup Scripts. Having this set to false, will not allow you to run scripts, but will save you some performance")
|
||||
public boolean useScripts=false;
|
||||
}
|
||||
|
|
@ -126,6 +132,8 @@ public class Configs {
|
|||
"animania:hamster",
|
||||
"animania:ferret*",
|
||||
"animania:hedgehog*",
|
||||
"animania:cart",
|
||||
"animania:wagon",
|
||||
"mynko:*"
|
||||
};
|
||||
}
|
||||
|
|
@ -148,6 +156,7 @@ public class Configs {
|
|||
"minecraft:flower_pot->(block)minecraft:flower_pot",
|
||||
"minecraft:leaves2->(item)minecraft:leaves2",
|
||||
"minecraft:reeds->(block)minecraft:reeds",
|
||||
"minecraft:daylight_detector_inverted->minecraft:daylight_detector",
|
||||
"quark:custom_chest{type:\"spruce\"}->quark:custom_chest;0",
|
||||
"quark:custom_chest{type:\"birch\"}->quark:custom_chest;1",
|
||||
"quark:custom_chest{type:\"jungle\"}->quark:custom_chest;2",
|
||||
|
|
@ -184,17 +193,17 @@ public class Configs {
|
|||
"storagedrawers:basicdrawers;4{Mat:\"acacia\"}->storagedrawers:basicdrawers;4{material:\"acacia\"}",
|
||||
"storagedrawers:basicdrawers;4{Mat:\"dark_oak\"}->storagedrawers:basicdrawers;4{material:\"dark_oak\"}",
|
||||
"animania:block_nest->(block)animania:block_nest",
|
||||
"animania:cheese_mold;0->(block)cheese_mold;0",
|
||||
"animania:cheese_mold;1->(block)cheese_mold;1",
|
||||
"animania:cheese_mold;2->(block)cheese_mold;2",
|
||||
"animania:cheese_mold;3->(block)cheese_mold;3",
|
||||
"animania:cheese_mold;4->(block)cheese_mold;4",
|
||||
"animania:cheese_mold;5->(block)cheese_mold;5",
|
||||
"animania:cheese_mold;6->(block)cheese_mold;6",
|
||||
"animania:cheese_mold;7->(block)cheese_mold;7",
|
||||
"animania:cheese_mold;8->(block)cheese_mold;8",
|
||||
"animania:cheese_mold;9->(block)cheese_mold;9",
|
||||
"animania:cheese_mold;10->(block)cheese_mold;10",
|
||||
"animania:cheese_mold;0->(block)animania:cheese_mold;0",
|
||||
"animania:cheese_mold;1->(block)animania:cheese_mold;1",
|
||||
"animania:cheese_mold;2->(block)animania:cheese_mold;2",
|
||||
"animania:cheese_mold;3->(block)animania:cheese_mold;3",
|
||||
"animania:cheese_mold;4->(block)animania:cheese_mold;4",
|
||||
"animania:cheese_mold;5->(block)animania:cheese_mold;5",
|
||||
"animania:cheese_mold;6->(block)animania:cheese_mold;6",
|
||||
"animania:cheese_mold;7->(block)animania:cheese_mold;7",
|
||||
"animania:cheese_mold;8->(block)animania:cheese_mold;8",
|
||||
"animania:cheese_mold;9->(block)animania:cheese_mold;9",
|
||||
"animania:cheese_mold;10->(block)animania:cheese_mold;10",
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package tschipp.carryon.common.event;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
|
|
@ -20,10 +21,13 @@ import net.minecraft.util.text.event.ClickEvent.Action;
|
|||
import net.minecraft.world.GameRules;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.player.AttackEntityEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
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.fml.common.eventhandler.Event.Result;
|
||||
import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
|
@ -31,6 +35,7 @@ import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
|
|||
import net.minecraftforge.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import tschipp.carryon.CarryOn;
|
||||
import tschipp.carryon.client.keybinds.CarryOnKeybinds;
|
||||
import tschipp.carryon.common.config.CarryOnConfig;
|
||||
import tschipp.carryon.common.handler.PickupHandler;
|
||||
import tschipp.carryon.common.handler.RegistrationHandler;
|
||||
import tschipp.carryon.common.item.ItemEntity;
|
||||
|
|
@ -93,9 +98,9 @@ public class ItemEvents
|
|||
eitem.setEntityItemStack(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerLogin(PlayerLoggedInEvent event)
|
||||
{
|
||||
|
|
@ -127,7 +132,6 @@ public class ItemEvents
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityStartTracking(StartTracking event)
|
||||
|
|
@ -163,13 +167,12 @@ public class ItemEvents
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void harvestSpeed(BreakSpeed event)
|
||||
{
|
||||
EntityPlayer player = event.getEntityPlayer();
|
||||
if(player != null)
|
||||
if (player != null && !CarryOnConfig.settings.hitWhileCarrying)
|
||||
{
|
||||
ItemStack stack = player.getHeldItemMainhand();
|
||||
if(stack == null ? false : (stack.getItem() == RegistrationHandler.itemTile || stack.getItem() == RegistrationHandler.itemEntity))
|
||||
|
|
@ -177,6 +180,51 @@ public class ItemEvents
|
|||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void attackEntity(AttackEntityEvent event)
|
||||
{
|
||||
EntityPlayer player = event.getEntityPlayer();
|
||||
ItemStack stack = player.getHeldItemMainhand();
|
||||
if (!CarryOnConfig.settings.hitWhileCarrying && stack == null ? false : (stack.getItem() == RegistrationHandler.itemTile || stack.getItem() == RegistrationHandler.itemEntity))
|
||||
{
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void harvestSpeed(BreakEvent event)
|
||||
{
|
||||
EntityPlayer player = event.getPlayer();
|
||||
if (player != null && !CarryOnConfig.settings.hitWhileCarrying)
|
||||
{
|
||||
ItemStack stack = player.getHeldItemMainhand();
|
||||
if (stack == null ? false : (stack.getItem() == RegistrationHandler.itemTile || stack.getItem() == RegistrationHandler.itemEntity))
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void playerAttack(LivingAttackEvent event)
|
||||
{
|
||||
EntityLivingBase eliving = event.getEntityLiving();
|
||||
if (eliving instanceof EntityPlayer && CarryOnConfig.settings.dropCarriedWhenHit)
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) eliving;
|
||||
ItemStack stack = player.getHeldItemMainhand();
|
||||
if (stack == null ? false : (stack.getItem() == RegistrationHandler.itemTile || stack.getItem() == RegistrationHandler.itemEntity))
|
||||
{
|
||||
if (!player.worldObj.isRemote)
|
||||
{
|
||||
player.setHeldItem(EnumHand.MAIN_HAND, null);
|
||||
EntityItem item = new EntityItem(player.worldObj, player.posX, player.posY, player.posZ, stack);
|
||||
player.worldObj.spawnEntityInWorld(item);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBlockRightClick(PlayerInteractEvent.RightClickBlock event) throws InstantiationException, IllegalAccessException
|
||||
{
|
||||
|
|
@ -238,7 +286,7 @@ public class ItemEvents
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRespawn(PlayerEvent.Clone event)
|
||||
{
|
||||
|
|
@ -248,18 +296,18 @@ public class ItemEvents
|
|||
GameRules rules = player.worldObj.getGameRules();
|
||||
boolean keepInv = rules.getBoolean("keepInventory");
|
||||
boolean wasCarrying = player.inventory.hasItemStack(new ItemStack(RegistrationHandler.itemTile)) || player.inventory.hasItemStack(new ItemStack(RegistrationHandler.itemEntity));
|
||||
|
||||
if((wasDead ? keepInv : true) && wasCarrying)
|
||||
|
||||
if ((wasDead ? keepInv : true) && wasCarrying)
|
||||
{
|
||||
int carrySlot = original.inventory.currentItem;
|
||||
|
||||
|
||||
ItemStack stack = player.inventory.removeStackFromSlot(carrySlot);
|
||||
World world = player.worldObj;
|
||||
|
||||
EntityItem item = new EntityItem(world);
|
||||
item.setEntityItemStack(stack);
|
||||
BlockPos pos = original.getBedLocation();
|
||||
if(pos == null)
|
||||
if (pos == null)
|
||||
pos = player.getPosition();
|
||||
item.setPosition(pos.getX(), pos.getY(), pos.getZ());
|
||||
world.spawnEntityInWorld(item);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import java.util.List;
|
|||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockStairs;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.properties.PropertyDirection;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
|
@ -119,7 +120,7 @@ public class ItemTile extends Item
|
|||
|
||||
if (prop instanceof PropertyDirection && this.equal(allowedValues, EnumFacing.HORIZONTALS))
|
||||
{
|
||||
world.setBlockState(pos2, containedstate.withProperty(prop, facing2.getOpposite()));
|
||||
world.setBlockState(pos2, containedstate.withProperty(prop, containedblock instanceof BlockStairs ? facing2 : facing2.getOpposite()));
|
||||
set = true;
|
||||
}
|
||||
else if (prop instanceof PropertyDirection && this.equal(allowedValues, EnumFacing.VALUES))
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
{
|
||||
"modid" : "carryon",
|
||||
"name" : "Carry On",
|
||||
"version" : "1.7", "mcversion" : "1.10.2",
|
||||
"version" : "1.7.1", "mcversion" : "1.10.2",
|
||||
"url" : "",
|
||||
"credits" : "Tschipp, Purplicious_Cow, cy4n",
|
||||
"authorList" : ["Tschipp, Purplicious_Cow, cy4n"],
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user