Added more mods to the default blacklist [1.11.2]
This commit is contained in:
parent
eb0a3f8536
commit
d146c7dd2b
|
|
@ -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.11,1.12)";
|
public static final String ACCEPTED_VERSIONS = "[1.11,1.12)";
|
||||||
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/";
|
||||||
|
|
|
||||||
|
|
@ -271,7 +271,6 @@ public class RenderEvents
|
||||||
event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GlStateManager.scale(1, 1, 1);
|
GlStateManager.scale(1, 1, 1);
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
|
|
||||||
|
|
@ -285,6 +284,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;
|
||||||
|
|
@ -292,7 +296,8 @@ public class RenderEvents
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private int getBrightnessForRender(EntityPlayer player)
|
private int getBrightnessForRender(EntityPlayer player)
|
||||||
|
|
|
||||||
|
|
@ -139,8 +139,11 @@ public class Configs {
|
||||||
"skyresources:*",
|
"skyresources:*",
|
||||||
"lootbags:*",
|
"lootbags:*",
|
||||||
"exsartagine:*",
|
"exsartagine:*",
|
||||||
"aquamunda:tank"
|
"aquamunda:tank",
|
||||||
|
"opencomputers:*",
|
||||||
|
"malisisdoors:*",
|
||||||
|
"industrialforegoing:*",
|
||||||
|
"minecolonies:*",
|
||||||
};
|
};
|
||||||
|
|
||||||
@Config.RequiresMcRestart()
|
@Config.RequiresMcRestart()
|
||||||
|
|
|
||||||
|
|
@ -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.darkhax.gamestages.capabilities.PlayerDataHandler;
|
import net.darkhax.gamestages.capabilities.PlayerDataHandler;
|
||||||
import net.darkhax.gamestages.capabilities.PlayerDataHandler.IStageData;
|
import net.darkhax.gamestages.capabilities.PlayerDataHandler.IStageData;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
|
@ -20,10 +16,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;
|
||||||
|
|
@ -46,7 +44,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
|
||||||
{
|
{
|
||||||
|
|
@ -56,6 +54,7 @@ public class PickupHandler
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
CarryOn.LOGGER.info("Block is allowed");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -71,19 +70,22 @@ 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 (CustomPickupOverrideHandler.hasSpecialPickupConditions(state))
|
if (CustomPickupOverrideHandler.hasSpecialPickupConditions(state))
|
||||||
{
|
{
|
||||||
IStageData stageData = PlayerDataHandler.getStageData(player);
|
IStageData stageData = PlayerDataHandler.getStageData(player);
|
||||||
String condition = CustomPickupOverrideHandler.getPickupCondition(state);
|
String condition = CustomPickupOverrideHandler.getPickupCondition(state);
|
||||||
if (stageData.hasUnlockedStage(condition))
|
if (stageData.hasUnlockedStage(condition))
|
||||||
return true && handleFTBUtils((EntityPlayerMP) player, world, pos, state);
|
return true && handleProtections((EntityPlayerMP) player, world, pos, state);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (CarryOnConfig.settings.pickupAllBlocks ? true : tile != null)
|
else if (CarryOnConfig.settings.pickupAllBlocks ? true : tile != null)
|
||||||
{
|
{
|
||||||
return true && handleFTBUtils((EntityPlayerMP) player, world, pos, state);
|
|
||||||
|
return true && handleProtections((EntityPlayerMP) player, world, pos, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -104,7 +106,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
|
||||||
{
|
{
|
||||||
|
|
@ -125,17 +127,17 @@ 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;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (CustomPickupOverrideHandler.hasSpecialPickupConditions(toPickUp))
|
if (CustomPickupOverrideHandler.hasSpecialPickupConditions(toPickUp))
|
||||||
{
|
{
|
||||||
IStageData stageData = PlayerDataHandler.getStageData(player);
|
IStageData stageData = PlayerDataHandler.getStageData(player);
|
||||||
String condition = CustomPickupOverrideHandler.getPickupCondition(toPickUp);
|
String condition = CustomPickupOverrideHandler.getPickupCondition(toPickUp);
|
||||||
if (stageData.hasUnlockedStage(condition))
|
if (stageData.hasUnlockedStage(condition))
|
||||||
return true;
|
return true && handleProtections((EntityPlayerMP) player, toPickUp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return true;
|
return true && handleProtections((EntityPlayerMP) player, toPickUp);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -177,10 +179,10 @@ public class PickupHandler
|
||||||
IStageData stageData = PlayerDataHandler.getStageData(player);
|
IStageData stageData = PlayerDataHandler.getStageData(player);
|
||||||
String condition = CustomPickupOverrideHandler.getPickupCondition(toPickUp);
|
String condition = CustomPickupOverrideHandler.getPickupCondition(toPickUp);
|
||||||
if (stageData.hasUnlockedStage(condition))
|
if (stageData.hasUnlockedStage(condition))
|
||||||
return true;
|
return true && handleProtections((EntityPlayerMP) player, toPickUp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return true;
|
return true && handleProtections((EntityPlayerMP) player, toPickUp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -191,14 +193,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
{
|
{
|
||||||
"modid" : "carryon",
|
"modid" : "carryon",
|
||||||
"name" : "Carry On",
|
"name" : "Carry On",
|
||||||
"version" : "1.9", "mcversion" : "1.11.2",
|
"version" : "1.9.1", "mcversion" : "1.11.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