Fixed comp. issue with ftbu and betterplacement
This commit is contained in:
parent
3dbd7deb84
commit
f0bb82ddc8
|
|
@ -47,8 +47,8 @@ dependencies {
|
|||
|
||||
deobfCompile "net.darkhax.gamestages:GameStages-1.12.2:1.0.76"
|
||||
|
||||
deobfCompile "LatMod:FTBUtilities:5.0.0"
|
||||
deobfCompile "LatMod:FTBLib:5.0.0"
|
||||
deobfCompile "LatMod:FTBUtilities:4.2.4"
|
||||
deobfCompile "LatMod:FTBLib:4.2.5"
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,9 +32,9 @@ public class CarryOn {
|
|||
public static CarryOn instance;
|
||||
|
||||
public static final String MODID = "carryon";
|
||||
public static final String VERSION = "1.7.1";
|
||||
public static final String VERSION = "1.7.2";
|
||||
public static final String NAME = "Carry On";
|
||||
public static final String ACCEPTED_VERSIONS = "[1.12,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 Logger LOGGER = LogManager.getFormatterLogger("CarryOn");
|
||||
public static File CONFIGURATION_FILE;
|
||||
|
|
|
|||
|
|
@ -131,6 +131,7 @@ public class RenderEvents
|
|||
event.setCanceled(true);
|
||||
Minecraft.getMinecraft().currentScreen = null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,9 @@ public class ItemEvents
|
|||
@SubscribeEvent(priority = EventPriority.HIGH)
|
||||
public void onBlockClick(PlayerInteractEvent.RightClickBlock event)
|
||||
{
|
||||
if(event.isCanceled())
|
||||
return;
|
||||
|
||||
EntityPlayer player = event.getEntityPlayer();
|
||||
ItemStack stack = player.getHeldItemMainhand();
|
||||
if (!stack.isEmpty() && stack.getItem() == RegistrationHandler.itemTile && ItemTile.hasTileData(stack))
|
||||
|
|
@ -240,15 +243,19 @@ public class ItemEvents
|
|||
Block block = world.getBlockState(pos).getBlock();
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
|
||||
|
||||
if (main.isEmpty() && off.isEmpty() && CarryOnKeybinds.isKeyPressed(player))
|
||||
{
|
||||
|
||||
ItemStack stack = new ItemStack(RegistrationHandler.itemTile);
|
||||
|
||||
TileEntity te = world.getTileEntity(pos);
|
||||
if (PickupHandler.canPlayerPickUpBlock(player, te, world, pos))
|
||||
{
|
||||
|
||||
if (ItemTile.storeTileData(te, world, pos, state.getActualState(world, pos), stack))
|
||||
{
|
||||
|
||||
IBlockState statee = world.getBlockState(pos);
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
tag = world.getTileEntity(pos) != null ? world.getTileEntity(pos).writeToNBT(tag) : new NBTTagCompound();
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ import java.util.UUID;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.feed_the_beast.ftblib.lib.math.BlockPosContainer;
|
||||
import com.feed_the_beast.ftbutilities.data.BlockInteractionType;
|
||||
import com.feed_the_beast.ftbutilities.data.ClaimedChunks;
|
||||
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.ClaimedChunks;
|
||||
|
||||
import net.darkhax.gamestages.capabilities.PlayerDataHandler;
|
||||
import net.darkhax.gamestages.capabilities.PlayerDataHandler.IStageData;
|
||||
|
|
@ -24,6 +24,7 @@ import net.minecraft.util.EnumHand;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import tschipp.carryon.CarryOn;
|
||||
import tschipp.carryon.common.config.CarryOnConfig;
|
||||
import tschipp.carryon.common.item.ItemTile;
|
||||
import tschipp.carryon.common.scripting.CarryOnOverride;
|
||||
|
|
@ -56,6 +57,7 @@ public class PickupHandler
|
|||
{
|
||||
return false;
|
||||
}
|
||||
CarryOn.LOGGER.info("Block is allowed");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -71,8 +73,10 @@ public class PickupHandler
|
|||
|
||||
if (distance < Math.pow(CarryOnConfig.settings.maxDistance, 2))
|
||||
{
|
||||
|
||||
if (!ItemTile.isLocked(pos, world))
|
||||
{
|
||||
|
||||
if (CustomPickupOverrideHandler.hasSpecialPickupConditions(state))
|
||||
{
|
||||
IStageData stageData = PlayerDataHandler.getStageData(player);
|
||||
|
|
@ -83,6 +87,7 @@ public class PickupHandler
|
|||
}
|
||||
else if (CarryOnConfig.settings.pickupAllBlocks ? true : tile != null)
|
||||
{
|
||||
|
||||
return true && handleFTBUtils((EntityPlayerMP) player, world, pos, state);
|
||||
}
|
||||
|
||||
|
|
@ -195,9 +200,14 @@ public class PickupHandler
|
|||
{
|
||||
if (Loader.isModLoaded("ftbu"))
|
||||
{
|
||||
|
||||
BlockPosContainer container = new BlockPosContainer(world, pos, state);
|
||||
return ClaimedChunks.instance.canPlayerInteract((EntityPlayerMP) player, EnumHand.MAIN_HAND, container, BlockInteractionType.CNB_BREAK);
|
||||
|
||||
boolean work = ClaimedChunks.INSTANCE.canPlayerInteract((EntityPlayerMP) player, EnumHand.MAIN_HAND, container, BlockInteractionType.CNB_BREAK);
|
||||
|
||||
return work;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,9 +21,11 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import tschipp.carryon.CarryOn;
|
||||
import tschipp.carryon.client.keybinds.CarryOnKeybinds;
|
||||
import tschipp.carryon.common.config.CarryOnConfig;
|
||||
import tschipp.carryon.network.client.CarrySlotPacket;
|
||||
|
||||
|
|
@ -90,6 +92,12 @@ public class ItemEntity extends Item
|
|||
ItemStack stack = player.getHeldItem(hand);
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
|
||||
if(Loader.isModLoaded("betterplacement"))
|
||||
{
|
||||
if(CarryOnKeybinds.isKeyPressed(player))
|
||||
return EnumActionResult.FAIL;
|
||||
}
|
||||
|
||||
if (hasEntityData(stack))
|
||||
{
|
||||
BlockPos finalPos = pos;
|
||||
|
|
|
|||
|
|
@ -33,9 +33,11 @@ import net.minecraft.util.text.event.ClickEvent;
|
|||
import net.minecraft.util.text.event.ClickEvent.Action;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import tschipp.carryon.CarryOn;
|
||||
import tschipp.carryon.client.keybinds.CarryOnKeybinds;
|
||||
import tschipp.carryon.common.config.CarryOnConfig;
|
||||
import tschipp.carryon.common.handler.CustomPickupOverrideHandler;
|
||||
import tschipp.carryon.common.handler.ModelOverridesHandler;
|
||||
|
|
@ -84,6 +86,13 @@ public class ItemTile extends Item
|
|||
@Override
|
||||
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if(Loader.isModLoaded("betterplacement"))
|
||||
{
|
||||
if(CarryOnKeybinds.isKeyPressed(player))
|
||||
return EnumActionResult.FAIL;
|
||||
}
|
||||
|
||||
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
if (hasTileData(stack))
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
{
|
||||
"modid" : "carryon",
|
||||
"name" : "Carry On",
|
||||
"version" : "1.7.1", "mcversion" : "1.12",
|
||||
"version" : "1.7.2", "mcversion" : "1.12.2",
|
||||
"url" : "",
|
||||
"credits" : "Tschipp, Purplicious_Cow, cy4n",
|
||||
"authorList" : ["Tschipp, Purplicious_Cow, cy4n"],
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user