This repository has been archived by the owner on Apr 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Showing
8 changed files
with
185 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
description = "A coremod full of patches and fixes made from black magic and suffering." | ||
|
||
archivesBaseName = "ExtraUtilities-Mixin" | ||
version = "1.0.1a" | ||
|
||
|
||
dependencies { | ||
compileOnly fileTree(dir: 'libs', include: ['*.jar']) //Current Folder Libs | ||
compileOnly fileTree(dir: '../libs', include: ['*.jar']) //Main Folder Libs | ||
|
||
compileOnly project(':Mixin-Forge') | ||
} |
Binary file not shown.
28 changes: 28 additions & 0 deletions
28
...in/java/io/github/crucible/grimoire/mixins/extrautilities/MixinTileEntityEnderQuarry.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,28 @@ | ||
package io.github.crucible.grimoire.mixins.extrautilities; | ||
|
||
import com.gamerforea.eventhelper.util.EventUtils; | ||
import com.rwtema.extrautils.tileentity.enderquarry.TileEntityEnderQuarry; | ||
import io.github.crucible.grimoire.forge.core.ITileEntity; | ||
import net.minecraft.tileentity.TileEntity; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Pseudo; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
/** | ||
* Created by Frani on 12/08/2017. | ||
*/ | ||
|
||
@Pseudo | ||
@Mixin(value = TileEntityEnderQuarry.class, remap = false) | ||
public abstract class MixinTileEntityEnderQuarry extends TileEntity implements ITileEntity { | ||
|
||
@Inject(method = "mineBlock", at = @At("HEAD"), cancellable = true) | ||
public void fireBreak(final int x, final int y, final int z, final boolean replaceWithDirt, CallbackInfoReturnable<Boolean> cir) { | ||
if (EventUtils.cantBreak(this.getFakePlayer(), x, y, z)) { | ||
cir.setReturnValue(false); | ||
} | ||
} | ||
|
||
} |
92 changes: 92 additions & 0 deletions
92
...n/java/io/github/crucible/grimoire/mixins/extrautilities/MixinTileEntityTransferNode.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 io.github.crucible.grimoire.mixins.extrautilities; | ||
|
||
import com.gamerforea.eventhelper.util.EventUtils; | ||
import com.rwtema.extrautils.ExtraUtils; | ||
import com.rwtema.extrautils.tileentity.enderquarry.IChunkLoad; | ||
import com.rwtema.extrautils.tileentity.transfernodes.Frequency; | ||
import com.rwtema.extrautils.tileentity.transfernodes.TileEntityTransferNode; | ||
import com.rwtema.extrautils.tileentity.transfernodes.TileEntityTransferNodeUpgradeInventory; | ||
import com.rwtema.extrautils.tileentity.transfernodes.TransferNodeEnderRegistry; | ||
import com.rwtema.extrautils.tileentity.transfernodes.nodebuffer.INode; | ||
import com.rwtema.extrautils.tileentity.transfernodes.nodebuffer.INodeBuffer; | ||
import com.rwtema.extrautils.tileentity.transfernodes.pipes.IPipe; | ||
import com.rwtema.extrautils.tileentity.transfernodes.pipes.IPipeCosmetic; | ||
import net.minecraft.tileentity.TileEntity; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Overwrite; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
|
||
|
||
@Mixin(value = TileEntityTransferNode.class, remap = false) | ||
public abstract class MixinTileEntityTransferNode extends TileEntity implements IPipe, INode, IPipeCosmetic, IChunkLoad { | ||
|
||
@Shadow | ||
public int pipe_type = 0; | ||
@Shadow | ||
public TileEntityTransferNodeUpgradeInventory upgrades; | ||
@Shadow | ||
public boolean isReceiver = false; | ||
@Shadow | ||
public INodeBuffer buffer; | ||
@Shadow | ||
public TileEntityTransferNode.SearchType searchType; | ||
@Shadow | ||
protected int maxCoolDown; | ||
@Shadow | ||
protected int stepCoolDown; | ||
|
||
/** | ||
* @author EverNife | ||
* @reason Desativar os upgrades de velocidade! | ||
*/ | ||
@Overwrite | ||
public void calcUpgradeModifiers() { | ||
if (this.worldObj != null && !this.worldObj.isRemote) { | ||
if (this.isReceiver) { | ||
TransferNodeEnderRegistry.clearTileRegistrations(this.buffer); | ||
} | ||
|
||
this.isReceiver = false; | ||
this.stepCoolDown = 2; | ||
TileEntityTransferNode.SearchType prevSearchType = this.searchType; | ||
this.searchType = TileEntityTransferNode.SearchType.RANDOM_WALK; | ||
int prev_pipe_type = this.pipe_type; | ||
if (this.upgrades.isValidPipeType(this.pipe_type)) { | ||
this.pipe_type = 0; | ||
} | ||
|
||
for(int i = 0; i < this.upgrades.getSizeInventory(); ++i) { | ||
if (this.upgrades.getStackInSlot(i) != null && ExtraUtils.nodeUpgrade != null && this.upgrades.getStackInSlot(i).getItem() == ExtraUtils.nodeUpgrade) { | ||
if (this.upgrades.getStackInSlot(i).getItemDamage() == 0) { | ||
//Mixin Replace maxCooldown with a limit of 6 | ||
for(int k = 0; k < this.upgrades.getStackInSlot(i).stackSize && this.stepCoolDown < 2; ++k) { | ||
++this.stepCoolDown; | ||
} | ||
} else if (this.upgrades.getStackInSlot(i).getItemDamage() == 6 && this.upgrades.getStackInSlot(i).hasDisplayName()) { | ||
TransferNodeEnderRegistry.registerTile(new Frequency(this.upgrades.getStackInSlot(i)), this.buffer); | ||
this.isReceiver = true; | ||
} else if (this.upgrades.getStackInSlot(i).getItemDamage() == 7) { | ||
this.searchType = TileEntityTransferNode.SearchType.DEPTH_FIRST; | ||
} else if (this.upgrades.getStackInSlot(i).getItemDamage() == 8) { | ||
this.searchType = TileEntityTransferNode.SearchType.BREADTH_FIRST; | ||
} | ||
} else if (this.upgrades.pipeType(this.upgrades.getStackInSlot(i)) > 0) { | ||
this.pipe_type = this.upgrades.pipeType(this.upgrades.getStackInSlot(i)); | ||
} | ||
} | ||
|
||
if (prevSearchType != this.searchType) { | ||
this.resetSearch(); | ||
} | ||
|
||
if (prev_pipe_type != this.pipe_type) { | ||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); | ||
} | ||
|
||
} | ||
} | ||
|
||
@Shadow | ||
public void resetSearch() { | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...lities/src/main/java/io/github/crucible/grimoire/mixins/extrautilities/MixinXUHelper.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,26 @@ | ||
package io.github.crucible.grimoire.mixins.extrautilities; | ||
|
||
import com.rwtema.extrautils.helper.XUHelper; | ||
import net.minecraft.world.World; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Pseudo; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
/** | ||
* Created by Frani on 13/06/2017. | ||
*/ | ||
|
||
@Pseudo | ||
@Mixin(value = XUHelper.class, remap = false) | ||
public abstract class MixinXUHelper { | ||
|
||
@Inject(method = "drainBlock", at = @At("HEAD"), cancellable = true) | ||
private static void injectDrainBlock(final World world, final int x, final int y, final int z, final boolean doDrain, CallbackInfoReturnable cir) { | ||
if(!world.blockExists(x, y, z)) { | ||
cir.cancel(); | ||
} | ||
} | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
Mixin-ExtraUtilities/src/main/resources/mixins.extrautilities.json
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,15 @@ | ||
{ | ||
"required": true, | ||
"package": "io.github.crucible.grimoire.mixins.extrautilities", | ||
"mixins":[ | ||
"MixinTileEntityEnderQuarry", | ||
"MixinTileEntityTransferNode", | ||
"MixinXUHelper" | ||
], | ||
"server": [], | ||
"client": [], | ||
"compatibilityLevel": "JAVA_8", | ||
"minVersion": "0.7.11", | ||
"target": "@env(INIT)", | ||
"refmap":"grimoire.refmap.json" | ||
} |
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