Skip to content

Commit

Permalink
Merge pull request #304 from MCTian-mi/pyrotech-integration
Browse files Browse the repository at this point in the history
Pyrotech integration
  • Loading branch information
bruberu authored Oct 6, 2024
2 parents 00d0fb3 + 7597cd6 commit 6c9e4e3
Show file tree
Hide file tree
Showing 21 changed files with 373 additions and 79 deletions.
7 changes: 4 additions & 3 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ dependencies {

implementation rfg.deobf('curse.maven:applecore-224472:2969118')

implementation rfg.deobf("curse.maven:no-tree-punching-289043:2983385") // No-tree-punching v2.0.21
implementation rfg.deobf("curse.maven:alcatrazcore-304493:2666560") // AlcatrazCore v1.0.4


implementation rfg.deobf("curse.maven:universal-mod-core-371784:4975229") // Universal-Mod-Care v1.2.1
implementation rfg.deobf("curse.maven:track-api-282613:2825260") // Track-API v1.2.0
Expand All @@ -66,5 +63,9 @@ dependencies {

compileOnly rfg.deobf("curse.maven:barrels-drums-storage-more-319404:2708193")

implementation rfg.deobf("curse.maven:pyrotech-306676:5351359")
implementation rfg.deobf("curse.maven:athenaeum-284350:4633750")
implementation rfg.deobf("curse.maven:dropt-284973:5405050")

api("CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.1.20.700")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package supersymmetry.api.metatileentity.multiblock;

import gregtech.api.metatileentity.multiblock.MultiblockAbility;
import net.minecraftforge.items.IItemHandlerModifiable;

public class SuSyMultiblockAbilities {
public static final MultiblockAbility<IItemHandlerModifiable> PRIMITIVE_IMPORT_ITEMS = new MultiblockAbility<>("primitive_import_items");
public static final MultiblockAbility<IItemHandlerModifiable> PRIMITIVE_EXPORT_ITEMS = new MultiblockAbility<>("primitive_export_items");
}
7 changes: 6 additions & 1 deletion src/main/java/supersymmetry/api/recipes/SuSyRecipeMaps.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import gregtech.api.recipes.builders.FuelRecipeBuilder;
import gregtech.api.recipes.builders.PrimitiveRecipeBuilder;
import gregtech.api.recipes.builders.SimpleRecipeBuilder;
import gregtech.api.unification.material.Materials;
import gregtech.api.recipes.ingredients.GTRecipeInput;
import gregtech.api.unification.material.Materials;
import gregtech.core.sound.GTSoundEvents;
import gregtechfoodoption.recipe.GTFORecipeMaps;
import supersymmetry.api.gui.SusyGuiTextures;
Expand Down Expand Up @@ -318,6 +318,11 @@ public class SuSyRecipeMaps {
.setSound(GTSoundEvents.TURBINE)
.allowEmptyOutput();

public static final RecipeMap<PrimitiveRecipeBuilder> PRIMITIVE_SMELTER = new RecipeMap<>("primitive_smelter", 4, 2, 0, 0, new PrimitiveRecipeBuilder(), false)
.setSlotOverlay(false, false, GuiTextures.FURNACE_OVERLAY_1)
.setSlotOverlay(true, false, GuiTextures.FURNACE_OVERLAY_2)
.setSound(GTSoundEvents.FURNACE);

public static void init(){
RecipeMaps.SIFTER_RECIPES.setMaxFluidInputs(1);
RecipeMaps.SIFTER_RECIPES.setMaxFluidOutputs(1);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package supersymmetry.client.renderer.textures;

import gregtech.client.renderer.texture.cube.OrientedOverlayRenderer;
import gregtech.client.renderer.texture.cube.SimpleCubeRenderer;
import gregtech.client.renderer.texture.cube.SimpleOverlayRenderer;
import gregtech.client.renderer.texture.cube.SimpleSidedCubeRenderer;

Expand Down Expand Up @@ -65,7 +66,11 @@ public SusyTextures(){
public static final OrientedOverlayRenderer ROTARY_KILN_OVERLAY = new OrientedOverlayRenderer("machines/multiblocks/rotary_kiln");
public static final OrientedOverlayRenderer SINTERING_OVERLAY = new OrientedOverlayRenderer("machines/multiblocks/sintering");
public static final OrientedOverlayRenderer SMOKE_STACK_OVERLAY = new OrientedOverlayRenderer("machines/multiblocks/smoke_stack");
public static final OrientedOverlayRenderer PRIMITIVE_SMELTER_OVERLAY = new OrientedOverlayRenderer("machines/multiblocks/primitive_smelter");

public static final SimpleOverlayRenderer SILICON_CARBIDE_CASING = new SimpleOverlayRenderer("multiblock_casing/silicon_carbide_casing");
public static final SimpleOverlayRenderer ULV_STRUCTURAL_CASING = new SimpleOverlayRenderer("multiblock_casing/ulv_structural_casing");
public static final SimpleOverlayRenderer SLAG_HOT = new SimpleOverlayRenderer("resource/slag_hot");

public static final SimpleCubeRenderer MASONRY_BRICK = new SimpleCubeRenderer("gregtech:blocks/multiblock_casing/masonry_brick");
}
2 changes: 2 additions & 0 deletions src/main/java/supersymmetry/common/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public static void registerBlocks(@NotNull RegistryEvent.Register<Block> event)
registry.register(SuSyBlocks.DRILL_HEAD);
registry.register(SuSyBlocks.DEPOSIT_BLOCK);
registry.register(SuSyBlocks.RESOURCE_BLOCK);
registry.register(SuSyBlocks.RESOURCE_BLOCK_1);
registry.register(SuSyBlocks.HOME);
registry.register(SuSyBlocks.MULTIBLOCK_TANK);
registry.register(SuSyBlocks.EVAPORATION_BED);
Expand Down Expand Up @@ -107,6 +108,7 @@ public static void registerItems(@NotNull RegistryEvent.Register<Item> event) {
registry.register(createItemBlock(SuSyBlocks.STRUCTURAL_BLOCK_1, VariantItemBlock::new));
registry.register(createItemBlock(SuSyBlocks.DEPOSIT_BLOCK, VariantItemBlock::new));
registry.register(createItemBlock(SuSyBlocks.RESOURCE_BLOCK, VariantItemBlock::new));
registry.register(createItemBlock(SuSyBlocks.RESOURCE_BLOCK_1, VariantItemBlock::new));
registry.register(createItemBlock(SuSyBlocks.HOME, VariantItemBlock::new));
registry.register(createItemBlock(SuSyBlocks.EVAPORATION_BED, VariantItemBlock::new));
registry.register(createItemBlock(SuSyBlocks.MULTIBLOCK_TANK, VariantItemBlock::new));
Expand Down
74 changes: 0 additions & 74 deletions src/main/java/supersymmetry/common/EventHandlers.java
Original file line number Diff line number Diff line change
@@ -1,49 +1,23 @@
package supersymmetry.common;

import com.alcatrazescapee.notreepunching.common.items.ItemCeramicBucket;
import com.alcatrazescapee.notreepunching.common.items.ModItems;
import gregtech.api.util.GTTeleporter;
import gregtech.api.util.TeleportHandler;
import gregtech.common.items.MetaItems;
import gregtechfoodoption.item.GTFOMetaItem;
import net.minecraft.block.BlockCauldron;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.management.PlayerList;
import net.minecraft.stats.StatList;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraftforge.event.entity.player.FillBucketEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidUtil;
import net.minecraftforge.fluids.capability.IFluidHandlerItem;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import supersymmetry.Supersymmetry;
import supersymmetry.api.SusyLog;
import supersymmetry.api.event.MobHordeEvent;
import supersymmetry.common.entities.EntityDropPod;
import supersymmetry.common.event.MobHordePlayerData;
import supersymmetry.common.event.MobHordeWorldData;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@Mod.EventBusSubscriber(modid = Supersymmetry.MODID)
public class EventHandlers {

Expand Down Expand Up @@ -77,54 +51,6 @@ public static void onPlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) {

}

@SubscribeEvent
@SuppressWarnings("all")
public static void onPlayerLeftClick(PlayerInteractEvent.RightClickBlock event) {
ItemStack itemStack = event.getItemStack();
World world = event.getWorld();
BlockPos pos = event.getPos();
IBlockState blockState = world.getBlockState(pos);
if (itemStack.getItem() == ModItems.CERAMIC_BUCKET && !world.isRemote && blockState.getBlock() instanceof BlockCauldron) {
event.setCanceled(true);
BlockCauldron cauldron = (BlockCauldron) blockState.getBlock();
ItemCeramicBucket bucket = (ItemCeramicBucket) itemStack.getItem();
FluidStack fluid = bucket.getFluid(itemStack);
int level = blockState.getValue(BlockCauldron.LEVEL);
if (fluid == null && level >= 3) {
if (!event.getEntityPlayer().capabilities.isCreativeMode) {
IFluidHandlerItem fluidHandler = FluidUtil.getFluidHandler(itemStack);
fluidHandler.fill(new FluidStack(FluidRegistry.WATER, 1000), true);
cancelFillBucket = true;
}

cauldron.setWaterLevel(world, pos, blockState, 0);
event.getEntityPlayer().addStat(StatList.CAULDRON_USED);
world.playSound(null, pos, SoundEvents.ITEM_BUCKET_FILL, SoundCategory.BLOCKS, 1.0F, 1.0F);
} else if (fluid != null && fluid.getFluid() == FluidRegistry.WATER && level < 3) {
if (!event.getEntityPlayer().capabilities.isCreativeMode) {
IFluidHandlerItem fluidHandler = FluidUtil.getFluidHandler(itemStack);
fluidHandler.drain(1000, true);
}
cancelFillBucket = true;

cauldron.setWaterLevel(world, pos, blockState, 3);
event.getEntityPlayer().addStat(StatList.CAULDRON_FILLED);
world.playSound(null, pos, SoundEvents.ITEM_BUCKET_EMPTY, SoundCategory.BLOCKS, 1.0F, 1.0F);
}
}
}

@SubscribeEvent
public static void onBucketFill(FillBucketEvent event) {
RayTraceResult target = event.getTarget();
if (cancelFillBucket &&
target != null &&
event.getWorld().getBlockState(target.getBlockPos()).getBlock() instanceof BlockCauldron) {
event.setCanceled(true);
cancelFillBucket = false;
}
}

@SubscribeEvent
public static void onTrySpawnPortal(BlockEvent.PortalSpawnEvent event) {
event.setCanceled(true);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/supersymmetry/common/blocks/BlockResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public enum ResourceBlockType implements IStringSerializable, IStateHarvestLevel
GOLD_ALLUVIAL("gold_alluvial", 1),
PHOSPHORITE("phosphorite", 1),
POTASH("potash", 1),
SULFUR("sulfur", 1);
SULFUR("sulfur", 1),
COAL("coal", 0);

private final String name;
private final int harvestLevel;
Expand Down
46 changes: 46 additions & 0 deletions src/main/java/supersymmetry/common/blocks/BlockResource1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package supersymmetry.common.blocks;

import gregtech.api.block.VariantBlock;
import net.minecraft.block.SoundType;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.IStringSerializable;

import javax.annotation.Nonnull;

public class BlockResource1 extends VariantBlock<BlockResource1.ResourceBlockType> {

public BlockResource1() {
super(net.minecraft.block.material.Material.IRON);
setTranslationKey("resource_block_1");
setHardness(3.0f);
setResistance(3.0f);
setSoundType(SoundType.METAL);
setHarvestLevel("pickaxe", 1);
setDefaultState(getState(ResourceBlockType.NATIVE_COPPER));
}

public enum ResourceBlockType implements IStringSerializable {
NATIVE_COPPER("native_copper", 1);

private final String name;
private final int harvestLevel;

ResourceBlockType(String name, int harvestLevel) {
this.name = name;
this.harvestLevel = harvestLevel;
}

@Nonnull
public String getName() {
return this.name;
}

public int getHarvestLevel(IBlockState state) {
return this.harvestLevel;
}

public String getHarvestTool(IBlockState state) {
return "pickaxe";
}
}
}
5 changes: 5 additions & 0 deletions src/main/java/supersymmetry/common/blocks/SuSyBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class SuSyBlocks {
public static BlockStructural1 STRUCTURAL_BLOCK_1;
public static BlockDeposit DEPOSIT_BLOCK;
public static BlockResource RESOURCE_BLOCK;
public static BlockResource1 RESOURCE_BLOCK_1;
public static BlockHome HOME;
public static BlockMultiblockTank MULTIBLOCK_TANK;
public static BlockEvaporationBed EVAPORATION_BED;
Expand Down Expand Up @@ -77,6 +78,9 @@ public static void init() {
RESOURCE_BLOCK = new BlockResource();
RESOURCE_BLOCK.setRegistryName("resource_block");

RESOURCE_BLOCK_1 = new BlockResource1();
RESOURCE_BLOCK_1.setRegistryName("resource_block_1");

HOME = new BlockHome();
HOME.setRegistryName("home_block");

Expand Down Expand Up @@ -112,6 +116,7 @@ public static void registerItemModels() {
registerItemModel(STRUCTURAL_BLOCK_1);
registerItemModel(DEPOSIT_BLOCK);
registerItemModel(RESOURCE_BLOCK);
registerItemModel(RESOURCE_BLOCK_1);
registerItemModel(HOME);
EVAPORATION_BED.onModelRegister();
MULTIBLOCK_TANK.onModelRegister();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import supersymmetry.common.metatileentities.multi.electric.*;
import supersymmetry.common.metatileentities.multi.primitive.MetaTileEntityCoagulationTank;
import supersymmetry.common.metatileentities.multi.primitive.MetaTileEntityPrimitiveMudPump;
import supersymmetry.common.metatileentities.multi.primitive.MetaTileEntityPrimitiveSmelter;
import supersymmetry.common.metatileentities.multiblockpart.MetaTileEntityPrimitiveItemBus;
import supersymmetry.common.metatileentities.multiblockpart.SusyMetaTileEntityDumpingHatch;
import supersymmetry.common.metatileentities.multiblockpart.SusyMetaTileEntityEnergyHatch;
import supersymmetry.common.metatileentities.single.electric.MetaTileEntityBathCondenser;
Expand Down Expand Up @@ -146,6 +148,10 @@ public class SuSyMetaTileEntities {
public static SimpleMachineMetaTileEntity[] TEXTILE_SPINNER;
public static SimpleMachineMetaTileEntity[] POLISHING_MACHINE;

public static MetaTileEntityPrimitiveSmelter PRIMITIVE_SMELTER;
public static MetaTileEntityPrimitiveItemBus PRIMITIVE_ITEM_IMPORT;
public static MetaTileEntityPrimitiveItemBus PRIMITIVE_ITEM_EXPORT;

public static void init() {
MAGNETIC_REFRIGERATOR = registerMetaTileEntity(14500, new MetaTileEntityMagneticRefrigerator(susyId("magnetic_refrigerator")));
COAGULATION_TANK = registerMetaTileEntity(14501, new MetaTileEntityCoagulationTank(susyId("coagulation_tank")));
Expand Down Expand Up @@ -191,6 +197,10 @@ public static void init() {
ELECTROLYTIC_CELL = registerMetaTileEntity(14634, new MetaTileEntityElectrolyticCell(susyId("electrolytic_cell")));
GRAVITY_SEPARATOR = registerMetaTileEntity(15052, new MetaTileEntityGravitySeparator(susyId("gravity_separator")));

PRIMITIVE_SMELTER = registerMetaTileEntity(14800, new MetaTileEntityPrimitiveSmelter(susyId("primitive_smelter")));
PRIMITIVE_ITEM_IMPORT = registerMetaTileEntity(14801, new MetaTileEntityPrimitiveItemBus(susyId("primitive_item_import"), false));
PRIMITIVE_ITEM_EXPORT = registerMetaTileEntity(14802, new MetaTileEntityPrimitiveItemBus(susyId("primitive_item_export"), true));

//oil stuff
COKING_TOWER = registerMetaTileEntity(14635, new MetaTileEntityCokingTower(susyId("coking_tower")));
VACUUM_DISTILLATION_TOWER = registerMetaTileEntity(14636, new MetaTileEntityVacuumDistillationTower(susyId("vacuum_distillation_tower")));
Expand Down
Loading

0 comments on commit 6c9e4e3

Please sign in to comment.