Merge branch 'master' into 1.10

This commit is contained in:
Tschipp 2018-07-06 16:46:29 +02:00
commit 07eb70aed5
5 changed files with 92 additions and 69 deletions

View File

@ -34,7 +34,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.9"; public static final String VERSION = "1.9.1";
public static final String NAME = "Carry On"; public static final String NAME = "Carry On";
public static final String ACCEPTED_VERSIONS = "[1.10,1.11)"; public static final String ACCEPTED_VERSIONS = "[1.10,1.11)";
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/";

View File

@ -267,7 +267,6 @@ public class RenderEvents
event.setCanceled(true); event.setCanceled(true);
} }
GlStateManager.scale(1, 1, 1); GlStateManager.scale(1, 1, 1);
GlStateManager.popMatrix(); GlStateManager.popMatrix();
@ -281,6 +280,11 @@ public class RenderEvents
RenderManager manager = mc.getRenderManager(); RenderManager manager = mc.getRenderManager();
RenderPlayer renderPlayer = manager.getSkinMap().get(aplayer.getSkinType()); RenderPlayer renderPlayer = manager.getSkinMap().get(aplayer.getSkinType());
ModelPlayer modelPlayer = renderPlayer.getMainModel(); ModelPlayer modelPlayer = renderPlayer.getMainModel();
if (modelPlayer != null)
{
if (modelPlayer.bipedLeftArm != null && modelPlayer.bipedRightArm != null)
{
modelPlayer.bipedLeftArm.isHidden = false; modelPlayer.bipedLeftArm.isHidden = false;
modelPlayer.bipedRightArm.isHidden = false; modelPlayer.bipedRightArm.isHidden = false;
modelPlayer.bipedLeftArmwear.isHidden = false; modelPlayer.bipedLeftArmwear.isHidden = false;
@ -288,7 +292,8 @@ public class RenderEvents
} }
} }
} }
}
}
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
private int getBrightnessForRender(EntityPlayer player) private int getBrightnessForRender(EntityPlayer player)

View File

@ -135,8 +135,11 @@ public class Configs {
"skyresources:*", "skyresources:*",
"lootbags:*", "lootbags:*",
"exsartagine:*", "exsartagine:*",
"aquamunda:tank" "aquamunda:tank",
"opencomputers:*",
"malisisdoors:*",
"industrialforegoing:*",
"minecolonies:*",
}; };
@Comment("Entities that cannot be picked up") @Comment("Entities that cannot be picked up")

View File

@ -4,10 +4,6 @@ import java.util.UUID;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import com.feed_the_beast.ftbl.lib.math.BlockPosContainer;
import com.feed_the_beast.ftbu.api.chunks.BlockInteractionType;
import com.feed_the_beast.ftbu.api_impl.ClaimedChunkStorage;
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;
@ -18,10 +14,12 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.common.Loader; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.AttackEntityEvent;
import net.minecraftforge.event.world.BlockEvent;
import tschipp.carryon.CarryOn;
import tschipp.carryon.common.config.CarryOnConfig; import tschipp.carryon.common.config.CarryOnConfig;
import tschipp.carryon.common.item.ItemTile; import tschipp.carryon.common.item.ItemTile;
import tschipp.carryon.common.scripting.CarryOnOverride; import tschipp.carryon.common.scripting.CarryOnOverride;
@ -44,7 +42,7 @@ public class PickupHandler
CarryOnOverride override = ScriptChecker.inspectBlock(world.getBlockState(pos), world, pos, tag); CarryOnOverride override = ScriptChecker.inspectBlock(world.getBlockState(pos), world, pos, tag);
if (override != null) if (override != null)
{ {
return (ScriptChecker.fulfillsConditions(override, player)) && handleFTBUtils((EntityPlayerMP) player, world, pos, state); return (ScriptChecker.fulfillsConditions(override, player)) && handleProtections((EntityPlayerMP) player, world, pos, state);
} }
else else
{ {
@ -54,6 +52,7 @@ public class PickupHandler
{ {
return false; return false;
} }
CarryOn.LOGGER.info("Block is allowed");
} }
else else
{ {
@ -69,11 +68,12 @@ public class PickupHandler
if (distance < Math.pow(CarryOnConfig.settings.maxDistance, 2)) if (distance < Math.pow(CarryOnConfig.settings.maxDistance, 2))
{ {
if (!ItemTile.isLocked(pos, world)) if (!ItemTile.isLocked(pos, world))
{ {
if (CarryOnConfig.settings.pickupAllBlocks ? true : tile != null) if (CarryOnConfig.settings.pickupAllBlocks ? true : tile != null)
{ {
return true && handleFTBUtils((EntityPlayerMP) player, world, pos, state); return true && handleProtections((EntityPlayerMP) player, world, pos, state);
} }
} }
@ -94,7 +94,7 @@ public class PickupHandler
CarryOnOverride override = ScriptChecker.inspectEntity(toPickUp); CarryOnOverride override = ScriptChecker.inspectEntity(toPickUp);
if (override != null) if (override != null)
{ {
return (ScriptChecker.fulfillsConditions(override, player)); return (ScriptChecker.fulfillsConditions(override, player)) && handleProtections((EntityPlayerMP) player, toPickUp);
} }
else else
{ {
@ -115,9 +115,9 @@ public class PickupHandler
if (tame.getOwnerId() != null && tame.getOwnerId() != player.getUUID(player.getGameProfile())) if (tame.getOwnerId() != null && tame.getOwnerId() != player.getUUID(player.getGameProfile()))
return false; return false;
} }
return true;
} }
else
return true && handleProtections((EntityPlayerMP) player, toPickUp);
} }
} }
@ -153,8 +153,7 @@ public class PickupHandler
if (owner != null && !owner.equals(playerID)) if (owner != null && !owner.equals(playerID))
return false; return false;
} }
return true && handleProtections((EntityPlayerMP) player, toPickUp);
return true;
} }
} }
} }
@ -165,14 +164,30 @@ public class PickupHandler
return false; return false;
} }
private static boolean handleFTBUtils(EntityPlayerMP player, World world, BlockPos pos, IBlockState state) private static boolean handleProtections(EntityPlayerMP player, World world, BlockPos pos, IBlockState state)
{ {
if (Loader.isModLoaded("ftbu")) boolean breakable = true;
{
BlockPosContainer container = new BlockPosContainer(world, pos, state); BlockEvent.BreakEvent event = new BlockEvent.BreakEvent(world, pos, state, player);
return ClaimedChunkStorage.INSTANCE.canPlayerInteract((EntityPlayerMP) player, EnumHand.MAIN_HAND, container, BlockInteractionType.CNB_BREAK); MinecraftForge.EVENT_BUS.post(event);
if (event.isCanceled())
breakable = false;
return breakable;
} }
return true;
private static boolean handleProtections(EntityPlayerMP player, Entity entity)
{
boolean canPickup = true;
AttackEntityEvent event = new AttackEntityEvent(player, entity);
MinecraftForge.EVENT_BUS.post(event);
if (event.isCanceled())
canPickup = false;
return canPickup;
} }
} }

View File

@ -2,7 +2,7 @@
{ {
"modid" : "carryon", "modid" : "carryon",
"name" : "Carry On", "name" : "Carry On",
"version" : "1.9", "mcversion" : "1.10.2", "version" : "1.9.1", "mcversion" : "1.10.2",
"url" : "", "url" : "",
"credits" : "Tschipp, Purplicious_Cow, cy4n", "credits" : "Tschipp, Purplicious_Cow, cy4n",
"authorList" : ["Tschipp, Purplicious_Cow, cy4n"], "authorList" : ["Tschipp, Purplicious_Cow, cy4n"],