-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f5abf2
commit e1147e6
Showing
56 changed files
with
1,145 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
loader-fabric/src/main/java/org/cyclops/colossalchests/ColossalChestsFabric.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
package org.cyclops.colossalchests; | ||
|
||
import net.fabricmc.api.ModInitializer; | ||
import net.minecraft.world.item.CreativeModeTab; | ||
import net.minecraft.world.item.ItemStack; | ||
import org.cyclops.colossalchests.advancement.criterion.ChestFormedTriggerConfig; | ||
import org.cyclops.colossalchests.block.ChestMaterial; | ||
import org.cyclops.colossalchests.block.ChestWallConfigFabric; | ||
import org.cyclops.colossalchests.block.ColossalChestConfigFabric; | ||
import org.cyclops.colossalchests.block.InterfaceConfigFabric; | ||
import org.cyclops.colossalchests.block.UncolossalChestConfigFabric; | ||
import org.cyclops.colossalchests.blockentity.BlockEntityColossalChestConfigFabric; | ||
import org.cyclops.colossalchests.blockentity.BlockEntityInterfaceConfigFabric; | ||
import org.cyclops.colossalchests.blockentity.BlockEntityUncolossalChestConfigFabric; | ||
import org.cyclops.colossalchests.condition.ConditionMetalVariantsSettingConfig; | ||
import org.cyclops.colossalchests.inventory.container.ContainerColossalChestConfig; | ||
import org.cyclops.colossalchests.inventory.container.ContainerUncolossalChestConfig; | ||
import org.cyclops.colossalchests.item.ItemUpgradeToolConfig; | ||
import org.cyclops.colossalchests.proxy.ClientProxyFabric; | ||
import org.cyclops.colossalchests.proxy.CommonProxyFabric; | ||
import org.cyclops.cyclopscore.config.ConfigHandlerCommon; | ||
import org.cyclops.cyclopscore.init.ModBaseFabric; | ||
import org.cyclops.cyclopscore.proxy.IClientProxyCommon; | ||
import org.cyclops.cyclopscore.proxy.ICommonProxyCommon; | ||
|
||
/** | ||
* The main mod class of ColossalChests. | ||
* @author rubensworks | ||
*/ | ||
public class ColossalChestsFabric extends ModBaseFabric<ColossalChestsFabric> implements ModInitializer { | ||
|
||
/** | ||
* The unique instance of this mod. | ||
*/ | ||
public static ColossalChestsFabric _instance; | ||
|
||
public ColossalChestsFabric() { | ||
super(Reference.MOD_ID, (instance) -> { | ||
ColossalChestsInstance.MOD = instance; | ||
_instance = instance; | ||
}); | ||
} | ||
|
||
@Override | ||
protected IClientProxyCommon constructClientProxy() { | ||
return new ClientProxyFabric(); | ||
} | ||
|
||
@Override | ||
protected ICommonProxyCommon constructCommonProxy() { | ||
return new CommonProxyFabric(); | ||
} | ||
|
||
@Override | ||
protected boolean hasDefaultCreativeModeTab() { | ||
return true; | ||
} | ||
|
||
@Override | ||
protected CreativeModeTab.Builder constructDefaultCreativeModeTab(CreativeModeTab.Builder builder) { | ||
return super.constructDefaultCreativeModeTab(builder) | ||
.icon(() -> new ItemStack(RegistryEntries.ITEM_CHEST)); | ||
} | ||
|
||
@Override | ||
protected void onConfigsRegister(ConfigHandlerCommon configHandler) { | ||
super.onConfigsRegister(configHandler); | ||
|
||
configHandler.addConfigurable(new GeneralConfig<>(this)); | ||
|
||
for (ChestMaterial material : ChestMaterial.VALUES) { | ||
configHandler.addConfigurable(new ChestWallConfigFabric<>(this, material)); | ||
configHandler.addConfigurable(new ColossalChestConfigFabric<>(this, material)); | ||
configHandler.addConfigurable(new InterfaceConfigFabric<>(this, material)); | ||
} | ||
configHandler.addConfigurable(new UncolossalChestConfigFabric<>(this)); | ||
|
||
configHandler.addConfigurable(new ItemUpgradeToolConfig<>(this, true)); | ||
configHandler.addConfigurable(new ItemUpgradeToolConfig<>(this, false)); | ||
|
||
configHandler.addConfigurable(new BlockEntityColossalChestConfigFabric<>(this)); | ||
configHandler.addConfigurable(new BlockEntityInterfaceConfigFabric<>(this)); | ||
configHandler.addConfigurable(new BlockEntityUncolossalChestConfigFabric<>(this)); | ||
|
||
configHandler.addConfigurable(new ContainerColossalChestConfig<>(this)); | ||
configHandler.addConfigurable(new ContainerUncolossalChestConfig<>(this)); | ||
|
||
configHandler.addConfigurable(new ConditionMetalVariantsSettingConfig()); | ||
|
||
configHandler.addConfigurable(new ChestFormedTriggerConfig<>(this)); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
loader-fabric/src/main/java/org/cyclops/colossalchests/block/ChestWallConfigFabric.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.cyclops.colossalchests.block; | ||
|
||
import net.minecraft.world.item.Item; | ||
import org.cyclops.colossalchests.item.ItemBlockMaterial; | ||
import org.cyclops.cyclopscore.init.IModBase; | ||
|
||
/** | ||
* Config for the {@link ChestWall}. | ||
* @author rubensworks | ||
* | ||
*/ | ||
public class ChestWallConfigFabric<M extends IModBase> extends ChestWallConfig<M> { | ||
|
||
public ChestWallConfigFabric(M mod, ChestMaterial material) { | ||
super( | ||
mod, | ||
"chest_wall_" + material.getName(), | ||
eConfig -> new ChestWallFabric(((ChestWallConfig<M>) eConfig).getProperties(), material), | ||
(eConfig, block) -> new ItemBlockMaterial(block, new Item.Properties(), material) | ||
); | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
loader-fabric/src/main/java/org/cyclops/colossalchests/block/ChestWallFabric.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.cyclops.colossalchests.block; | ||
|
||
import net.minecraft.world.level.Level; | ||
import org.cyclops.cyclopscore.events.IBlockExplodedEvent; | ||
|
||
/** | ||
* @author rubensworks | ||
*/ | ||
public class ChestWallFabric extends ChestWall { | ||
public ChestWallFabric(Properties properties, ChestMaterial material) { | ||
super(properties, material); | ||
IBlockExplodedEvent.EVENT.register((blockState, level, blockPos, explosion, biConsumer) -> onBlockExplodedCommon(blockState, level, blockPos, explosion)); | ||
} | ||
|
||
@Override | ||
protected boolean isCaptureBlockSnapshots(Level level) { | ||
return false; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
loader-fabric/src/main/java/org/cyclops/colossalchests/block/ColossalChestConfigFabric.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.cyclops.colossalchests.block; | ||
|
||
import net.minecraft.world.item.Item; | ||
import org.cyclops.colossalchests.item.ItemBlockMaterial; | ||
import org.cyclops.cyclopscore.init.IModBase; | ||
|
||
/** | ||
* Config for the {@link ColossalChest}. | ||
* @author rubensworks | ||
* | ||
*/ | ||
public class ColossalChestConfigFabric<M extends IModBase> extends ColossalChestConfig<M> { | ||
|
||
public ColossalChestConfigFabric(M mod, ChestMaterial material) { | ||
super( | ||
mod, | ||
"colossal_chest_" + material.getName(), | ||
eConfig -> new ColossalChestFabric(((ColossalChestConfig<M>) eConfig).getProperties(), material), | ||
(eConfig, block) -> new ItemBlockMaterial(block, new Item.Properties(), material) | ||
); | ||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
loader-fabric/src/main/java/org/cyclops/colossalchests/block/ColossalChestFabric.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.cyclops.colossalchests.block; | ||
|
||
import net.minecraft.world.level.Level; | ||
import org.cyclops.colossalchests.blockentity.BlockEntityColossalChest; | ||
import org.cyclops.cyclopscore.events.IBlockExplodedEvent; | ||
|
||
/** | ||
* @author rubensworks | ||
*/ | ||
public class ColossalChestFabric extends ColossalChest { | ||
public ColossalChestFabric(Properties properties, ChestMaterial material) { | ||
super(properties, material, BlockEntityColossalChest::new); | ||
IBlockExplodedEvent.EVENT.register((blockState, level, blockPos, explosion, biConsumer) -> onBlockExplodedCommon(blockState, level, blockPos, explosion)); | ||
} | ||
|
||
@Override | ||
protected boolean isCaptureBlockSnapshots(Level level) { | ||
return false; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
loader-fabric/src/main/java/org/cyclops/colossalchests/block/InterfaceConfigFabric.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.cyclops.colossalchests.block; | ||
|
||
import net.minecraft.world.item.Item; | ||
import org.cyclops.colossalchests.item.ItemBlockMaterial; | ||
import org.cyclops.cyclopscore.init.IModBase; | ||
|
||
/** | ||
* Config for the {@link Interface}. | ||
* @author rubensworks | ||
* | ||
*/ | ||
public class InterfaceConfigFabric<M extends IModBase> extends InterfaceConfig<M> { | ||
|
||
public InterfaceConfigFabric(M mod, ChestMaterial material) { | ||
super( | ||
mod, | ||
"interface_" + material.getName(), | ||
eConfig -> new InterfaceFabric(((InterfaceConfig<M>) eConfig).getProperties(), material), | ||
(eConfig, block) -> new ItemBlockMaterial(block, new Item.Properties(), material) | ||
); | ||
} | ||
|
||
} |
Oops, something went wrong.