Revert ore dict comment & remove useless stuff

This commit is contained in:
ProfessorProspector 2018-09-16 14:01:00 -07:00
parent 269e297d9e
commit c568876caa
6 changed files with 20 additions and 129 deletions

View file

@ -77,8 +77,6 @@ import java.io.File;
@Mod(modid = TechReborn.MOD_ID, name = TechReborn.MOD_NAME, version = TechReborn.MOD_VERSION, dependencies = TechReborn.MOD_DEPENDENCIES, acceptedMinecraftVersions = "[1.12,1.12.2]", certificateFingerprint = "8727a3141c8ec7f173b87aa78b9b9807867c4e6b", guiFactory = "techreborn.client.TechRebornGuiFactory")
public class TechReborn {
//enable dev featues with -Dtechreborn.devFeatues=true
public static final boolean DEV_FEATURES = Boolean.parseBoolean(System.getProperty("techreborn.devFeatues", "false"));
public static final String MOD_ID = "techreborn";
public static final String MOD_NAME = "Tech Reborn";
public static final String MOD_VERSION = "@MODVERSION@";
@ -86,6 +84,7 @@ public class TechReborn {
public static final String CLIENT_PROXY_CLASS = "techreborn.proxies.ClientProxy";
public static final String SERVER_PROXY_CLASS = "techreborn.proxies.CommonProxy";
public static final String GUI_FACTORY_CLASS = "techreborn.config.TechRebornGUIFactory";
public static final Logger LOGGER = LogManager.getLogger(MOD_ID);
@SidedProxy(clientSide = TechReborn.CLIENT_PROXY_CLASS, serverSide = TechReborn.SERVER_PROXY_CLASS)
public static CommonProxy proxy;

View file

@ -1,46 +0,0 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2018 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.client.keybindings;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.InputEvent;
import techreborn.TechReborn;
import techreborn.lib.Key;
public class KeyInputEventHandler {
private static Key getPressedKeybinding() {
if (KeyBindings.config.isPressed()) {
return Key.CONFIG;
}
return Key.UNKNOWN;
}
@SubscribeEvent
public void handleKeyInputEvent(InputEvent.KeyInputEvent event) {
TechReborn.LOGGER.info(getPressedKeybinding());
}
}

View file

@ -36,7 +36,7 @@ import java.util.ArrayList;
import java.util.List;
public class ModLoot {
public static List<ResourceLocation> lootTables = new ArrayList<ResourceLocation>();
public static void init() {
@ -58,7 +58,7 @@ public class ModLoot {
if (ConfigTechReborn.enableEndLoot) {
lootTables.add(new ResourceLocation(TechReborn.MOD_ID, "chests/end_city_treasure"));
}
for (ResourceLocation lootTable : lootTables) {
LootTableList.register(lootTable);
}
@ -66,28 +66,26 @@ public class ModLoot {
@SubscribeEvent
public void lootLoad(LootTableLoadEvent event) {
if(!event.getName().getNamespace().equals("minecraft")) {
if (!event.getName().getNamespace().equals("minecraft")) {
return;
}
for (ResourceLocation lootTable : lootTables) {
if (event.getName().getNamespace().equals(lootTable.getPath())) {
event.getTable().addPool(getLootPool(lootTable));
if (TechReborn.DEV_FEATURES) {
TechReborn.LOGGER.info("Loot pool injected into " + lootTable.getPath());
}
TechReborn.LOGGER.debug("Loot pool injected into " + lootTable.getPath());
}
}
}
/**
* Generates loot pool to be injected into vanilla loot pools
*
*
* @param lootTable ResourceLocation Loot table to inject
* @return LootPool Loot pool to inject
*/
private LootPool getLootPool(ResourceLocation lootTable) {
LootEntry entry = new LootEntryTable(lootTable, 1, 0, new LootCondition[0], "lootEntry_" + lootTable.toString());
LootPool pool = new LootPool(new LootEntry[] {entry}, new LootCondition[0], new RandomValueRange(1), new RandomValueRange(0, 1), "lootPool_"+lootTable.toString());
LootEntry entry = new LootEntryTable(lootTable, 1, 0, new LootCondition[0], "lootEntry_" + lootTable.toString());
LootPool pool = new LootPool(new LootEntry[] { entry }, new LootCondition[0], new RandomValueRange(1), new RandomValueRange(0, 1), "lootPool_" + lootTable.toString());
return pool;
}
}

View file

@ -24,9 +24,11 @@
package techreborn.items.tools;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Blocks;
import net.minecraft.init.Enchantments;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack;
@ -39,7 +41,7 @@ import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.PowerSystem;
import reborncore.common.powerSystem.PoweredItemCapabilityProvider;
import reborncore.common.util.ItemUtils;
import techreborn.utils.InitUtils;
import techreborn.utils.OreDictUtils;
import javax.annotation.Nullable;
import java.util.Random;
@ -61,13 +63,12 @@ public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo {
// ItemPickaxe
@Override
public float getDestroySpeed(ItemStack stack, IBlockState state) {
//tOdo: check if stone tag
// if ((OreDictUtils.isOre(state, "stone") || state.getBlock() == Blocks.STONE)
// && stack.getCapability(CapabilityEnergy.ENERGY, null).getEnergyStored() >= cost) {
// return efficiency;
// } else {
return 0.5F;
// }
if ((OreDictUtils.isOre(state, "stone") || state.getBlock() == Blocks.STONE)
&& stack.getCapability(CapabilityEnergy.ENERGY, null).getEnergyStored() >= cost) {
return efficiency;
} else {
return 0.5F;
}
}
// ItemTool
@ -88,10 +89,8 @@ public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo {
// Item
@Override
public boolean canHarvestBlock(final IBlockState state, final ItemStack stack) {
return false;
//todo: cheeck if stone tag
// return OreDictUtils.isOre(state, "stone")
// || state.getMaterial() == Material.ROCK && stack.getCapability(CapabilityEnergy.ENERGY, null).getEnergyStored() >= cost;
return OreDictUtils.isOre(state, "stone")
|| state.getMaterial() == Material.ROCK && stack.getCapability(CapabilityEnergy.ENERGY, null).getEnergyStored() >= cost;
}
@Override

View file

@ -1,30 +0,0 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2018 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.lib;
public enum Key {
UNKNOWN, CONFIG
}

View file

@ -1,29 +0,0 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2018 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.lib;
public class TRConstants {
}