-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Draconic Evolution Energy Core & Pylon Improvements and Fixes
Log Improvements Localise 'Error at' messages Improve Energy Pylon Validation and Update Logic
- Loading branch information
1 parent
ca73b12
commit d125453
Showing
14 changed files
with
138 additions
and
61 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
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
31 changes: 31 additions & 0 deletions
31
src/main/java/com/nomiceu/nomilabs/mixin/draconicevolution/EnergyPylonMixin.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,31 @@ | ||
package com.nomiceu.nomilabs.mixin.draconicevolution; | ||
|
||
import com.brandon3055.brandonscore.blocks.BlockBCore; | ||
import com.brandon3055.draconicevolution.blocks.machines.EnergyPylon; | ||
import com.brandon3055.draconicevolution.blocks.tileentity.TileEnergyPylon; | ||
import com.nomiceu.nomilabs.NomiLabs; | ||
import net.minecraft.block.state.IBlockState; | ||
import net.minecraft.entity.EntityLivingBase; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Unique; | ||
|
||
/** | ||
* Checks if the pylon is valid on place, instead of after block update. | ||
* <br> | ||
* Prevents instances when replacing of glass is needed. | ||
*/ | ||
@Mixin(value = EnergyPylon.class, remap = false) | ||
public abstract class EnergyPylonMixin extends BlockBCore { | ||
@Override | ||
@Unique | ||
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { | ||
super.onBlockPlacedBy(world, pos, state, placer, stack); | ||
if (world.getTileEntity(pos) instanceof TileEnergyPylon tile) { | ||
NomiLabs.LOGGER.info("Success!"); | ||
tile.validateStructure(); | ||
} else NomiLabs.LOGGER.info("Fail!"); | ||
} | ||
} |
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
Oops, something went wrong.