Remove achievements as they are going away in 1.12 and were broken.
This commit is contained in:
parent
a6d0e57d10
commit
2e1de815a9
4 changed files with 0 additions and 171 deletions
|
@ -45,7 +45,6 @@ import reborncore.common.network.RegisterPacketEvent;
|
|||
import reborncore.common.packets.AddDiscriminatorEvent;
|
||||
import reborncore.common.util.LogHelper;
|
||||
import reborncore.common.util.VersionChecker;
|
||||
import techreborn.achievement.TRAchievements;
|
||||
import techreborn.api.TechRebornAPI;
|
||||
import techreborn.client.GuiHandler;
|
||||
import techreborn.command.TechRebornDevCommand;
|
||||
|
@ -171,8 +170,6 @@ public class Core {
|
|||
// Register Gui Handler
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(INSTANCE, new GuiHandler());
|
||||
|
||||
// Achievements
|
||||
TRAchievements.init();
|
||||
// Multiblock events
|
||||
MinecraftForge.EVENT_BUS.register(new MultiblockEventHandler());
|
||||
// IDSU manager
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2017 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.achievement;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AchievementMod extends Achievement {
|
||||
|
||||
public static List<Achievement> achievements = new ArrayList();
|
||||
|
||||
public AchievementMod(String name, int x, int y, ItemStack icon, Achievement parent) {
|
||||
super("achievement.techreborn:" + name, "TechReborn:" + name, x, y, icon, parent);
|
||||
achievements.add(this);
|
||||
registerStat();
|
||||
}
|
||||
|
||||
public AchievementMod(String name, int x, int y, Item icon, Achievement parent) {
|
||||
this(name, x, y, new ItemStack(icon), parent);
|
||||
}
|
||||
|
||||
public AchievementMod(String name, int x, int y, Block icon, Achievement parent) {
|
||||
this(name, x, y, new ItemStack(icon), parent);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2017 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.achievement;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.PlayerEvent.ItemPickupEvent;
|
||||
import reborncore.common.achievement.ICraftAchievement;
|
||||
import reborncore.common.achievement.IPickupAchievement;
|
||||
|
||||
public class AchievementTriggerer {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onItemPickedUp(ItemPickupEvent event) {
|
||||
ItemStack stack = event.pickedUp.getEntityItem();
|
||||
if (stack != ItemStack.EMPTY && stack.getItem() instanceof IPickupAchievement) {
|
||||
Achievement achievement = ((IPickupAchievement) stack.getItem()).getAchievementOnPickup(stack, event.player,
|
||||
event.pickedUp);
|
||||
if (achievement != null)
|
||||
event.player.addStat(achievement, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onItemCrafted(ItemCraftedEvent event) {
|
||||
if (event.crafting != ItemStack.EMPTY && event.crafting.getItem() instanceof ICraftAchievement) {
|
||||
Achievement achievement = ((ICraftAchievement) event.crafting.getItem())
|
||||
.getAchievementOnCraft(event.crafting, event.player, event.craftMatrix);
|
||||
if (achievement != null)
|
||||
event.player.addStat(achievement, 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2017 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.achievement;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraftforge.common.AchievementPage;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
public class TRAchievements {
|
||||
|
||||
public static AchievementPage techrebornPage;
|
||||
public static int pageIndex;
|
||||
|
||||
public static Achievement ore_PickUp;
|
||||
public static Achievement thermalgen_Craft;
|
||||
public static Achievement centrifuge_Craft;
|
||||
|
||||
public static void init() {
|
||||
ore_PickUp = new AchievementMod("ore_PickUp", 0, 0, new ItemStack(ModBlocks.ORE, 1, 0), null);
|
||||
centrifuge_Craft = new AchievementMod("centrifuge_Craft", 1, 1, ModBlocks.INDUSTRIAL_CENTRIFUGE, ore_PickUp);
|
||||
thermalgen_Craft = new AchievementMod("thermalgen_Craft", 2, 1, ModBlocks.THERMAL_GENERATOR, ore_PickUp);
|
||||
|
||||
pageIndex = AchievementPage.getAchievementPages().size();
|
||||
techrebornPage = new AchievementPage(ModInfo.MOD_NAME,
|
||||
AchievementMod.achievements.toArray(new Achievement[AchievementMod.achievements.size()]));
|
||||
AchievementPage.registerAchievementPage(techrebornPage);
|
||||
|
||||
FMLCommonHandler.instance().bus().register(new AchievementTriggerer());
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue