Abstract ic2 in RebornCore, rewrite Reborn Core's configs
This commit is contained in:
parent
1dd864f467
commit
7db621fbed
10 changed files with 16 additions and 21 deletions
|
@ -131,7 +131,7 @@ public class Core {
|
||||||
logHelper.info("PreInitialization Complete");
|
logHelper.info("PreInitialization Complete");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent(priority = EventPriority.LOW)//LOW is used as we want it to load as late as possible, but before crafttweaker
|
@SubscribeEvent(priority = EventPriority.LOW)//LOW is used as we want it to tick as late as possible, but before crafttweaker
|
||||||
public void registerRecipes(RegistryEvent.Register<IRecipe> event) {
|
public void registerRecipes(RegistryEvent.Register<IRecipe> event) {
|
||||||
//Register ModRecipes
|
//Register ModRecipes
|
||||||
ModRecipes.init();
|
ModRecipes.init();
|
||||||
|
@ -167,7 +167,7 @@ public class Core {
|
||||||
//Village stuff
|
//Village stuff
|
||||||
VillagerRegistry.instance().registerVillageCreationHandler(new VillagePlantaionHandler());
|
VillagerRegistry.instance().registerVillageCreationHandler(new VillagePlantaionHandler());
|
||||||
MapGenStructureIO.registerStructureComponent(VillageComponentRubberPlantaion.class, new ResourceLocation(ModInfo.MOD_ID, "rubberplantation").toString());
|
MapGenStructureIO.registerStructureComponent(VillageComponentRubberPlantaion.class, new ResourceLocation(ModInfo.MOD_ID, "rubberplantation").toString());
|
||||||
ModLootTables.CHESTS_RUBBER_PLANTATION.toString(); //Done to make it load, then it will be read from disk
|
ModLootTables.CHESTS_RUBBER_PLANTATION.toString(); //Done to make it tick, then it will be read from disk
|
||||||
// Scrapbox
|
// Scrapbox
|
||||||
if (BehaviorDispenseScrapbox.dispenseScrapboxes) {
|
if (BehaviorDispenseScrapbox.dispenseScrapboxes) {
|
||||||
BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(ModItems.SCRAP_BOX, new BehaviorDispenseScrapbox());
|
BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(ModItems.SCRAP_BOX, new BehaviorDispenseScrapbox());
|
||||||
|
|
|
@ -29,7 +29,7 @@ import reborncore.common.registration.impl.ConfigRegistry;
|
||||||
import techreborn.lib.ModInfo;
|
import techreborn.lib.ModInfo;
|
||||||
|
|
||||||
|
|
||||||
//This is in its own class as not to load the block class before
|
//This is in its own class as not to tick the block class before
|
||||||
@RebornRegistry(modID = ModInfo.MOD_ID, priority = 1, earlyReg = true)
|
@RebornRegistry(modID = ModInfo.MOD_ID, priority = 1, earlyReg = true)
|
||||||
public class OreBlockStateManager {
|
public class OreBlockStateManager {
|
||||||
//This is a one off config, dont worry about it
|
//This is a one off config, dont worry about it
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class ModelHelper {
|
||||||
|
|
||||||
return ModelBlock.deserialize(getReaderForResource(location)).getAllTransforms();
|
return ModelBlock.deserialize(getReaderForResource(location)).getAllTransforms();
|
||||||
} catch (IOException exception) {
|
} catch (IOException exception) {
|
||||||
Core.logHelper.warn("Can't load resource " + location);
|
Core.logHelper.warn("Can't tick resource " + location);
|
||||||
exception.printStackTrace();
|
exception.printStackTrace();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class RecipesIC2 implements ICompatModule {
|
||||||
MinecraftForge.EVENT_BUS.register(this);
|
MinecraftForge.EVENT_BUS.register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// LOW is used as we want it to load as late as possible, but before crafttweaker
|
// LOW is used as we want it to tick as late as possible, but before crafttweaker
|
||||||
@SubscribeEvent(priority = EventPriority.LOW)
|
@SubscribeEvent(priority = EventPriority.LOW)
|
||||||
public void registerRecipes(RegistryEvent.Register<IRecipe> event) {
|
public void registerRecipes(RegistryEvent.Register<IRecipe> event) {
|
||||||
recipeDuplicateList.add(new RecipeDuplicate(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 0),
|
recipeDuplicateList.add(new RecipeDuplicate(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 0),
|
||||||
|
|
|
@ -92,7 +92,7 @@ public class StackToolTipEvent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (NullPointerException e) {
|
} catch (NullPointerException e) {
|
||||||
Core.logHelper.debug("Failed to load info for " + event.getItemStack().getDisplayName());
|
Core.logHelper.debug("Failed to tick info for " + event.getItemStack().getDisplayName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,10 +32,11 @@ import net.minecraftforge.energy.IEnergyStorage;
|
||||||
import reborncore.api.IToolDrop;
|
import reborncore.api.IToolDrop;
|
||||||
import reborncore.api.tile.IInventoryProvider;
|
import reborncore.api.tile.IInventoryProvider;
|
||||||
import reborncore.common.RebornCoreConfig;
|
import reborncore.common.RebornCoreConfig;
|
||||||
|
import reborncore.common.powerSystem.ExternalPowerSystems;
|
||||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||||
import reborncore.common.registration.RebornRegistry;
|
import reborncore.common.registration.RebornRegistry;
|
||||||
import reborncore.common.registration.impl.ConfigRegistry;
|
import reborncore.common.registration.impl.ConfigRegistry;
|
||||||
import reborncore.common.util.IC2ItemCharger;
|
import reborncore.ic2.IC2ItemCharger;
|
||||||
import reborncore.common.util.Inventory;
|
import reborncore.common.util.Inventory;
|
||||||
import reborncore.client.containerBuilder.IContainerProvider;
|
import reborncore.client.containerBuilder.IContainerProvider;
|
||||||
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
import reborncore.client.containerBuilder.builder.BuiltContainer;
|
||||||
|
@ -77,8 +78,8 @@ public class TileChargeOMat extends TilePowerAcceptor
|
||||||
if (getEnergy() >= 0.0 && maxReceive > 0) {
|
if (getEnergy() >= 0.0 && maxReceive > 0) {
|
||||||
powerItem.receiveEnergy((int) useEnergy(maxUse) * RebornCoreConfig.euPerFU, false);
|
powerItem.receiveEnergy((int) useEnergy(maxUse) * RebornCoreConfig.euPerFU, false);
|
||||||
}
|
}
|
||||||
} else if (CompatManager.isIC2Loaded) {
|
} else if (ExternalPowerSystems.isPoweredItem(stack)) {
|
||||||
IC2ItemCharger.chargeIc2Item(this, stack);
|
ExternalPowerSystems.chargeItem(this, stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class TileCable extends TileEntity
|
||||||
private ArrayList<EnumFacing> sendingFace = new ArrayList<EnumFacing>();
|
private ArrayList<EnumFacing> sendingFace = new ArrayList<EnumFacing>();
|
||||||
int ticksSinceLastChange = 0;
|
int ticksSinceLastChange = 0;
|
||||||
|
|
||||||
//MC calls this during world load. Keep it, please.
|
//MC calls this during world tick. Keep it, please.
|
||||||
public TileCable() {
|
public TileCable() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,13 +91,6 @@ public class TileCreativeSolarPanel extends TilePowerAcceptor implements IToolDr
|
||||||
return new ItemStack(ModBlocks.SOLAR_PANEL);
|
return new ItemStack(ModBlocks.SOLAR_PANEL);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Done to prevent ic2 from exploding the adjacent blocks
|
|
||||||
@Override
|
|
||||||
@Optional.Method(modid = "ic2")
|
|
||||||
public int getSourceTier() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handleTierWithPower() {
|
public boolean handleTierWithPower() {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -138,7 +138,7 @@ public class TileSolarPanel extends TilePowerAcceptor implements IToolDrop {
|
||||||
if(tag.hasKey("panelType")){
|
if(tag.hasKey("panelType")){
|
||||||
panel = EnumPanelType.values()[tag.getInteger("panelType")];
|
panel = EnumPanelType.values()[tag.getInteger("panelType")];
|
||||||
} else {
|
} else {
|
||||||
Core.logHelper.warn("A solar panel has failed to load from NBT, it will not work correctly. Please break and replace it to fix the issue. BlockPos:" + pos.toString());
|
Core.logHelper.warn("A solar panel has failed to tick from NBT, it will not work correctly. Please break and replace it to fix the issue. BlockPos:" + pos.toString());
|
||||||
panel = EnumPanelType.Basic;
|
panel = EnumPanelType.Basic;
|
||||||
}
|
}
|
||||||
super.readFromNBT(tag);
|
super.readFromNBT(tag);
|
||||||
|
|
|
@ -34,8 +34,9 @@ import reborncore.api.IToolDrop;
|
||||||
import reborncore.api.power.EnumPowerTier;
|
import reborncore.api.power.EnumPowerTier;
|
||||||
import reborncore.api.tile.IInventoryProvider;
|
import reborncore.api.tile.IInventoryProvider;
|
||||||
import reborncore.common.RebornCoreConfig;
|
import reborncore.common.RebornCoreConfig;
|
||||||
|
import reborncore.common.powerSystem.ExternalPowerSystems;
|
||||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||||
import reborncore.common.util.IC2ItemCharger;
|
import reborncore.ic2.IC2ItemCharger;
|
||||||
import reborncore.common.util.Inventory;
|
import reborncore.common.util.Inventory;
|
||||||
import techreborn.blocks.storage.BlockEnergyStorage;
|
import techreborn.blocks.storage.BlockEnergyStorage;
|
||||||
import techreborn.compat.CompatManager;
|
import techreborn.compat.CompatManager;
|
||||||
|
@ -78,8 +79,8 @@ public class TileEnergyStorage extends TilePowerAcceptor
|
||||||
if (getEnergy() >= 0.0 && maxReceive > 0) {
|
if (getEnergy() >= 0.0 && maxReceive > 0) {
|
||||||
powerItem.receiveEnergy((int) useEnergy(maxUse) * RebornCoreConfig.euPerFU, false);
|
powerItem.receiveEnergy((int) useEnergy(maxUse) * RebornCoreConfig.euPerFU, false);
|
||||||
}
|
}
|
||||||
} else if (CompatManager.isIC2Loaded) {
|
} else if (ExternalPowerSystems.isPoweredItem(stack)) {
|
||||||
IC2ItemCharger.chargeIc2Item(this, stack);
|
ExternalPowerSystems.chargeItem(this, stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!inventory.getStackInSlot(1).isEmpty()) {
|
if (!inventory.getStackInSlot(1).isEmpty()) {
|
||||||
|
|
Loading…
Reference in a new issue