Abstract ic2 in RebornCore, rewrite Reborn Core's configs

This commit is contained in:
modmuss50 2018-12-08 20:15:20 +00:00
parent 1dd864f467
commit 7db621fbed
10 changed files with 16 additions and 21 deletions

View file

@ -131,7 +131,7 @@ public class Core {
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) {
//Register ModRecipes
ModRecipes.init();
@ -167,7 +167,7 @@ public class Core {
//Village stuff
VillagerRegistry.instance().registerVillageCreationHandler(new VillagePlantaionHandler());
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
if (BehaviorDispenseScrapbox.dispenseScrapboxes) {
BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(ModItems.SCRAP_BOX, new BehaviorDispenseScrapbox());

View file

@ -29,7 +29,7 @@ import reborncore.common.registration.impl.ConfigRegistry;
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)
public class OreBlockStateManager {
//This is a one off config, dont worry about it

View file

@ -53,7 +53,7 @@ public class ModelHelper {
return ModelBlock.deserialize(getReaderForResource(location)).getAllTransforms();
} catch (IOException exception) {
Core.logHelper.warn("Can't load resource " + location);
Core.logHelper.warn("Can't tick resource " + location);
exception.printStackTrace();
return null;
}

View file

@ -62,7 +62,7 @@ public class RecipesIC2 implements ICompatModule {
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)
public void registerRecipes(RegistryEvent.Register<IRecipe> event) {
recipeDuplicateList.add(new RecipeDuplicate(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 0),

View file

@ -92,7 +92,7 @@ public class StackToolTipEvent {
}
}
} 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());
}
}
}

View file

@ -32,10 +32,11 @@ import net.minecraftforge.energy.IEnergyStorage;
import reborncore.api.IToolDrop;
import reborncore.api.tile.IInventoryProvider;
import reborncore.common.RebornCoreConfig;
import reborncore.common.powerSystem.ExternalPowerSystems;
import reborncore.common.powerSystem.TilePowerAcceptor;
import reborncore.common.registration.RebornRegistry;
import reborncore.common.registration.impl.ConfigRegistry;
import reborncore.common.util.IC2ItemCharger;
import reborncore.ic2.IC2ItemCharger;
import reborncore.common.util.Inventory;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
@ -77,8 +78,8 @@ public class TileChargeOMat extends TilePowerAcceptor
if (getEnergy() >= 0.0 && maxReceive > 0) {
powerItem.receiveEnergy((int) useEnergy(maxUse) * RebornCoreConfig.euPerFU, false);
}
} else if (CompatManager.isIC2Loaded) {
IC2ItemCharger.chargeIc2Item(this, stack);
} else if (ExternalPowerSystems.isPoweredItem(stack)) {
ExternalPowerSystems.chargeItem(this, stack);
}
}
}

View file

@ -60,7 +60,7 @@ public class TileCable extends TileEntity
private ArrayList<EnumFacing> sendingFace = new ArrayList<EnumFacing>();
int ticksSinceLastChange = 0;
//MC calls this during world load. Keep it, please.
//MC calls this during world tick. Keep it, please.
public TileCable() {
super();
}

View file

@ -91,13 +91,6 @@ public class TileCreativeSolarPanel extends TilePowerAcceptor implements IToolDr
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
public boolean handleTierWithPower() {
return false;

View file

@ -138,7 +138,7 @@ public class TileSolarPanel extends TilePowerAcceptor implements IToolDrop {
if(tag.hasKey("panelType")){
panel = EnumPanelType.values()[tag.getInteger("panelType")];
} 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;
}
super.readFromNBT(tag);

View file

@ -34,8 +34,9 @@ import reborncore.api.IToolDrop;
import reborncore.api.power.EnumPowerTier;
import reborncore.api.tile.IInventoryProvider;
import reborncore.common.RebornCoreConfig;
import reborncore.common.powerSystem.ExternalPowerSystems;
import reborncore.common.powerSystem.TilePowerAcceptor;
import reborncore.common.util.IC2ItemCharger;
import reborncore.ic2.IC2ItemCharger;
import reborncore.common.util.Inventory;
import techreborn.blocks.storage.BlockEnergyStorage;
import techreborn.compat.CompatManager;
@ -78,8 +79,8 @@ public class TileEnergyStorage extends TilePowerAcceptor
if (getEnergy() >= 0.0 && maxReceive > 0) {
powerItem.receiveEnergy((int) useEnergy(maxUse) * RebornCoreConfig.euPerFU, false);
}
} else if (CompatManager.isIC2Loaded) {
IC2ItemCharger.chargeIc2Item(this, stack);
} else if (ExternalPowerSystems.isPoweredItem(stack)) {
ExternalPowerSystems.chargeItem(this, stack);
}
}
if (!inventory.getStackInSlot(1).isEmpty()) {