-
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
1 parent
6a181cb
commit 8d07fa9
Showing
6 changed files
with
87 additions
and
0 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
30 changes: 30 additions & 0 deletions
30
src/main/java/github/kasuminova/stellarcore/mixin/cfm/MixinTileEntitySyncClient.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,30 @@ | ||
package github.kasuminova.stellarcore.mixin.cfm; | ||
|
||
import com.mrcrayfish.furniture.tileentity.TileEntitySyncClient; | ||
import github.kasuminova.stellarcore.common.config.StellarCoreConfig; | ||
import net.minecraft.block.state.IBlockState; | ||
import net.minecraft.tileentity.TileEntity; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Unique; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
@Mixin(TileEntitySyncClient.class) | ||
public class MixinTileEntitySyncClient extends TileEntity { | ||
|
||
@Unique | ||
@Override | ||
public boolean shouldRefresh(@Nonnull final World world, | ||
@Nonnull final BlockPos pos, | ||
@Nonnull final IBlockState oldState, | ||
@Nonnull final IBlockState newSate) | ||
{ | ||
if (!StellarCoreConfig.BUG_FIXES.mrCrayfishFurniture.tileEntityFurniture) { | ||
return super.shouldRefresh(world, pos, oldState, newSate); | ||
} | ||
return oldState.getBlock() != newSate.getBlock(); | ||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
...n/java/github/kasuminova/stellarcore/mixin/sync_techguns/MixinTileEntityDualVertical.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,35 @@ | ||
package github.kasuminova.stellarcore.mixin.sync_techguns; | ||
|
||
import com.llamalad7.mixinextras.sugar.Local; | ||
import github.kasuminova.stellarcore.common.config.StellarCoreConfig; | ||
import me.ichun.mods.sync.common.tileentity.TileEntityDualVertical; | ||
import net.minecraft.entity.player.EntityPlayerMP; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
import techguns.api.capabilities.ITGExtendedPlayer; | ||
import techguns.capabilities.TGExtendedPlayerCapProvider; | ||
|
||
|
||
@Mixin(TileEntityDualVertical.class) | ||
@SuppressWarnings("MethodMayBeStatic") | ||
public class MixinTileEntityDualVertical { | ||
|
||
@Inject(method = "update", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/entity/player/EntityPlayerMP;writeToNBT(Lnet/minecraft/nbt/NBTTagCompound;)Lnet/minecraft/nbt/NBTTagCompound;" | ||
) | ||
) | ||
private void injectUpdateClearInventory(final CallbackInfo ci, @Local(name = "dummy") EntityPlayerMP dummy) { | ||
if (!StellarCoreConfig.BUG_FIXES.sync.techgunsDuplicationFixes) { | ||
return; | ||
} | ||
ITGExtendedPlayer tgCap = dummy.getCapability(TGExtendedPlayerCapProvider.TG_EXTENDED_PLAYER, null); | ||
if (tgCap != null) { | ||
tgCap.getTGInventory().clear(); | ||
} | ||
} | ||
|
||
} |
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,10 @@ | ||
{ | ||
"package": "github.kasuminova.stellarcore.mixin.sync_techguns", | ||
"refmap": "mixins.stellar_core.refmap.json", | ||
"target": "@env(DEFAULT)", | ||
"minVersion": "0.8", | ||
"compatibilityLevel": "JAVA_8", | ||
"mixins": [ | ||
"MixinTileEntityDualVertical" | ||
] | ||
} |