Skip to content

Commit

Permalink
mixin methods now include deeperdarker in their names for better dete…
Browse files Browse the repository at this point in the history
…ction during a crash
  • Loading branch information
NewJumper committed May 18, 2024
1 parent b5cf1c8 commit c256de3
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@Mixin(value = { AbstractFurnaceMenu.class, BeaconMenu.class, BrewingStandMenu.class, CartographyTableMenu.class, ChestMenu.class, CraftingMenu.class, DispenserMenu.class, EnchantmentMenu.class, GrindstoneMenu.class, HopperMenu.class, ItemCombinerMenu.class, LoomMenu.class, ShulkerBoxMenu.class, StonecutterMenu.class })
public class ContainerMenuMixin {
@Inject(method = "stillValid", at = @At("HEAD"), cancellable = true)
public void stillValid(Player player, CallbackInfoReturnable<Boolean> cir) {
public void deeperdarker_stillValid(Player player, CallbackInfoReturnable<Boolean> cir) {
ItemStack transmitter = ItemStack.EMPTY;
if(player.getMainHandItem().is(DDItems.SCULK_TRANSMITTER.get()) && SculkTransmitterItem.isLinked(player.getMainHandItem())) {
transmitter = player.getMainHandItem();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public abstract class HangingEntityItemMixin {
private EntityType<? extends HangingEntity> type;

@Inject(method = "appendHoverText", at = @At("HEAD"), cancellable = true)
public void appendHoverText(ItemStack stack, Level level, List<Component> tooltips, TooltipFlag isAdvanced, CallbackInfo ci) {
public void deeperdarker_appendHoverText(ItemStack stack, Level level, List<Component> tooltips, TooltipFlag isAdvanced, CallbackInfo ci) {
if(this.type == EntityType.PAINTING) {
CompoundTag tag = stack.getTag();
if(tag != null && tag.contains("EntityTag", 10)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected PaintingMixin(EntityType<? extends HangingEntity> pEntityType, Level p
public abstract Holder<PaintingVariant> getVariant();

@Inject(method = "dropItem", at = @At("HEAD"), cancellable = true)
public void dropItem(Entity entity, CallbackInfo cir) {
public void deeperdarker_dropItem(Entity entity, CallbackInfo cir) {
if(getVariant().is(DDTags.Misc.ANCIENT_PAINTING) && this.level().getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
this.playSound(SoundEvents.PAINTING_BREAK, 1, 1);
if(entity instanceof Player player && player.getAbilities().instabuild) return;
Expand All @@ -45,7 +45,7 @@ public void dropItem(Entity entity, CallbackInfo cir) {
}

@Inject(method = "getPickResult", at = @At("RETURN"))
public void getPickResult(CallbackInfoReturnable<ItemStack> cir) {
public void deeperdarker_getPickResult(CallbackInfoReturnable<ItemStack> cir) {
if(getVariant().is(DDTags.Misc.ANCIENT_PAINTING)) {
CompoundTag tag = cir.getReturnValue().getOrCreateTagElement("EntityTag");
Painting.storeVariant(tag, getVariant());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@Mixin(PhantomRenderer.class)
public class PhantomRendererMixin {
@Inject(method = "getTextureLocation", at = @At("HEAD"), cancellable = true)
public void getTextureLocation(Phantom entity, CallbackInfoReturnable<ResourceLocation> cir) {
public void deeperdarker_getTextureLocation(Phantom entity, CallbackInfoReturnable<ResourceLocation> cir) {
if(entity.level().getBiome(entity.blockPosition()).is(OthersideBiomes.DEEPLANDS.location())) {
cir.setReturnValue(new ResourceLocation(DeeperDarker.MOD_ID, "textures/entity/sculk_phantom.png"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@Mixin(VibrationSystem.Listener.class)
public class VibrationListenerMixin {
@Inject(method = "handleGameEvent", at = @At("HEAD"), cancellable = true)
public void handleGameEvent(ServerLevel level, GameEvent event, GameEvent.Context context, Vec3 vec3, CallbackInfoReturnable<Boolean> cir) {
public void deeperdarker_handleGameEvent(ServerLevel level, GameEvent event, GameEvent.Context context, Vec3 vec3, CallbackInfoReturnable<Boolean> cir) {
if(context.sourceEntity() instanceof LivingEntity entity) {
if(entity.getMobType().equals(DDMobType.SCULK)) cir.setReturnValue(false);
if(entity.hasEffect(DDEffects.SCULK_AFFINITY.get())) cir.setReturnValue(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public WardenMixin(EntityType<? extends Monster> pEntityType, Level pLevel) {
}

@Inject(method = "canTargetEntity", at = @At("HEAD"), cancellable = true)
public void canTargetEntity(Entity target, CallbackInfoReturnable<Boolean> cir) {
public void deeperdarker_canTargetEntity(Entity target, CallbackInfoReturnable<Boolean> cir) {
if(target instanceof LivingEntity entity && entity.getMobType() == DDMobType.SCULK) cir.setReturnValue(false);
}
}

0 comments on commit c256de3

Please sign in to comment.