Updated to the lastest version of Gamestages [1.12.2]
This commit is contained in:
parent
5ac582566d
commit
324b055dea
|
|
@ -42,7 +42,7 @@ repositories {
|
|||
|
||||
dependencies {
|
||||
|
||||
deobfCompile "net.darkhax.gamestages:GameStages-1.12.2:1.0.76"
|
||||
deobfCompile "net.darkhax.gamestages:GameStages-1.12.2:2.0.91"
|
||||
|
||||
deobfCompile "com.feed_the_beast.mods:FTBLib:5.0.2.11"
|
||||
deobfCompile "com.feed_the_beast.mods:FTBUtilities:5.0.2.11"
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public class CarryOn {
|
|||
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 final String DEPENDENCIES = "required-after:forge@[13.20.1.2386,);after:ftbu@[5.0.0.11,);after:gamestages@[1.0.76,2.0.00)";
|
||||
public static final String DEPENDENCIES = "required-after:forge@[13.20.1.2386,);after:ftbu@[5.0.0.11,);after:gamestages@[2.0.91,)";
|
||||
public static File CONFIGURATION_FILE;
|
||||
|
||||
public static SimpleNetworkWrapper network;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import net.minecraft.util.text.event.ClickEvent;
|
|||
import net.minecraft.util.text.event.ClickEvent.Action;
|
||||
import net.minecraft.world.GameRules;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.player.AttackEntityEvent;
|
||||
|
|
@ -300,6 +301,7 @@ public class ItemEvents
|
|||
s.getStyle().setClickEvent(new ClickEvent(Action.OPEN_URL, "https://github.com/Tschipp/CarryOn/issues"));
|
||||
player.sendMessage(new TextComponentString(TextFormatting.RED + "Please report this error ").appendSibling(s));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ 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 net.darkhax.gamestages.capabilities.PlayerDataHandler;
|
||||
import net.darkhax.gamestages.capabilities.PlayerDataHandler.IStageData;
|
||||
import net.darkhax.gamestages.GameStageHelper;
|
||||
import net.darkhax.gamestages.data.IStageData;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
|
@ -23,6 +23,8 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import tschipp.carryon.CarryOn;
|
||||
import tschipp.carryon.common.config.CarryOnConfig;
|
||||
|
|
@ -47,7 +49,7 @@ public class PickupHandler
|
|||
CarryOnOverride override = ScriptChecker.inspectBlock(world.getBlockState(pos), world, pos, tag);
|
||||
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
|
||||
{
|
||||
|
|
@ -79,16 +81,16 @@ public class PickupHandler
|
|||
|
||||
if (CustomPickupOverrideHandler.hasSpecialPickupConditions(state))
|
||||
{
|
||||
IStageData stageData = PlayerDataHandler.getStageData(player);
|
||||
IStageData stageData = GameStageHelper.getPlayerData(player);
|
||||
String condition = CustomPickupOverrideHandler.getPickupCondition(state);
|
||||
if (stageData.hasUnlockedStage(condition))
|
||||
return true && handleFTBUtils((EntityPlayerMP) player, world, pos, state);
|
||||
if (stageData.hasStage(condition))
|
||||
return true && handleProtections((EntityPlayerMP) player, world, pos, state);
|
||||
|
||||
}
|
||||
else if (CarryOnConfig.settings.pickupAllBlocks ? true : tile != null)
|
||||
{
|
||||
|
||||
return true && handleFTBUtils((EntityPlayerMP) player, world, pos, state);
|
||||
return true && handleProtections((EntityPlayerMP) player, world, pos, state);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -134,9 +136,9 @@ public class PickupHandler
|
|||
|
||||
if (CustomPickupOverrideHandler.hasSpecialPickupConditions(toPickUp))
|
||||
{
|
||||
IStageData stageData = PlayerDataHandler.getStageData(player);
|
||||
IStageData stageData = GameStageHelper.getPlayerData(player);
|
||||
String condition = CustomPickupOverrideHandler.getPickupCondition(toPickUp);
|
||||
if (stageData.hasUnlockedStage(condition))
|
||||
if (stageData.hasStage(condition))
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
|
@ -179,9 +181,9 @@ public class PickupHandler
|
|||
|
||||
if (CustomPickupOverrideHandler.hasSpecialPickupConditions(toPickUp))
|
||||
{
|
||||
IStageData stageData = PlayerDataHandler.getStageData(player);
|
||||
IStageData stageData = GameStageHelper.getPlayerData(player);
|
||||
String condition = CustomPickupOverrideHandler.getPickupCondition(toPickUp);
|
||||
if (stageData.hasUnlockedStage(condition))
|
||||
if (stageData.hasStage(condition))
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
|
@ -196,19 +198,23 @@ public class PickupHandler
|
|||
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)
|
||||
{
|
||||
boolean breakable = true;
|
||||
if (Loader.isModLoaded("ftbu"))
|
||||
{
|
||||
|
||||
BlockPosContainer container = new BlockPosContainer(world, pos, state);
|
||||
|
||||
boolean work = ClaimedChunks.instance.canPlayerInteract((EntityPlayerMP) player, EnumHand.MAIN_HAND, container, BlockInteractionType.CNB_BREAK);
|
||||
|
||||
return work;
|
||||
breakable = ClaimedChunks.instance.canPlayerInteract((EntityPlayerMP) player, EnumHand.MAIN_HAND, container, BlockInteractionType.CNB_BREAK);
|
||||
}
|
||||
|
||||
return true;
|
||||
BlockEvent.BreakEvent event = new BlockEvent.BreakEvent(world, pos, state, player);
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
|
||||
if(event.isCanceled())
|
||||
breakable = false;
|
||||
|
||||
return breakable;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package tschipp.carryon.common.scripting;
|
|||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.darkhax.gamestages.capabilities.PlayerDataHandler;
|
||||
import net.darkhax.gamestages.GameStageHelper;
|
||||
import net.minecraft.advancements.Advancement;
|
||||
import net.minecraft.advancements.AdvancementManager;
|
||||
import net.minecraft.block.Block;
|
||||
|
|
@ -104,7 +104,7 @@ public class ScriptChecker
|
|||
|
||||
boolean achievement = adv == null ? true : ((EntityPlayerMP)player).getAdvancements().getProgress(adv).isDone();
|
||||
boolean gamemode = ScriptParseHelper.matches(((EntityPlayerMP) player).interactionManager.getGameType().getID(), override.getConditionGamemode());
|
||||
boolean gamestage = Loader.isModLoaded("gamestages") ? (override.getConditionGamestage() != null ? PlayerDataHandler.getStageData(player).hasUnlockedStage(override.getConditionGamestage()) : true) : true;
|
||||
boolean gamestage = Loader.isModLoaded("gamestages") ? (override.getConditionGamestage() != null ? GameStageHelper.getPlayerData(player).hasStage(override.getConditionGamestage()) : true) : true;
|
||||
boolean position = ScriptParseHelper.matches(player.getPosition(), override.getConditionPosition());
|
||||
boolean xp = ScriptParseHelper.matches(player.experienceLevel, override.getConditionXp());
|
||||
boolean scoreboard = ScriptParseHelper.matchesScore(player, override.getConditionScoreboard());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
[
|
||||
{
|
||||
"ingredient": {
|
||||
"type": "forge:ore_dict",
|
||||
"ore": "enderpearl"
|
||||
},
|
||||
"name": "ENDERPEARL"
|
||||
},
|
||||
{
|
||||
"ingredient": {
|
||||
"type": "forge:ore_dict",
|
||||
"ore": "gemDiamond"
|
||||
},
|
||||
"name": "GEMDIAMOND"
|
||||
},
|
||||
{
|
||||
"ingredient": {
|
||||
"type": "forge:ore_dict",
|
||||
"ore": "ingotIron"
|
||||
},
|
||||
"name": "INGOTIRON"
|
||||
},
|
||||
{
|
||||
"ingredient": {
|
||||
"type": "forge:ore_dict",
|
||||
"ore": "nuggetIron"
|
||||
},
|
||||
"name": "NUGGETIRON"
|
||||
},
|
||||
{
|
||||
"ingredient": {
|
||||
"type": "forge:ore_dict",
|
||||
"ore": "paper"
|
||||
},
|
||||
"name": "PAPER"
|
||||
},
|
||||
{
|
||||
"ingredient": {
|
||||
"type": "forge:ore_dict",
|
||||
"ore": "stone"
|
||||
},
|
||||
"name": "STONE"
|
||||
}
|
||||
]
|
||||
Loading…
Reference in New Issue
Block a user