generated from SmushyTaco/Example-Mod
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'forge-dev' into forge-release/1.21
# Conflicts: # StaffMod/src/main/kotlin/opekope2/avm_staff/api/entity/CakeEntity.kt # gradle/libs.versions.toml
- Loading branch information
Showing
125 changed files
with
5,162 additions
and
1,772 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
StaffMod/src/main/java/opekope2/avm_staff/mixin/AbstractFurnaceBlockEntityMixin.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,39 @@ | ||
/* | ||
* AvM Staff Mod | ||
* Copyright (c) 2024 opekope2 | ||
* | ||
* This mod is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This mod is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this mod. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package opekope2.avm_staff.mixin; | ||
|
||
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; | ||
import net.minecraft.block.entity.AbstractFurnaceBlockEntity; | ||
import net.minecraft.util.Identifier; | ||
import opekope2.avm_staff.api.block.IClearableBeforeInsertedIntoStaff; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
|
||
@Mixin(AbstractFurnaceBlockEntity.class) | ||
public abstract class AbstractFurnaceBlockEntityMixin implements IClearableBeforeInsertedIntoStaff { | ||
@Shadow | ||
@Final | ||
private Object2IntOpenHashMap<Identifier> recipesUsed; | ||
|
||
@Override | ||
public void staffMod_clearBeforeRemovedFromWorld() { | ||
recipesUsed.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
38 changes: 38 additions & 0 deletions
38
StaffMod/src/main/java/opekope2/avm_staff/mixin/IBellBlockEntityAccessor.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,38 @@ | ||
/* | ||
* AvM Staff Mod | ||
* Copyright (c) 2024 opekope2 | ||
* | ||
* This mod is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This mod is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this mod. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package opekope2.avm_staff.mixin; | ||
|
||
import net.minecraft.block.entity.BellBlockEntity; | ||
import net.minecraft.entity.LivingEntity; | ||
import net.minecraft.util.math.BlockPos; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Invoker; | ||
|
||
@Mixin(BellBlockEntity.class) | ||
public interface IBellBlockEntityAccessor { | ||
@Invoker | ||
static void callApplyGlowToEntity(LivingEntity entity) { | ||
throw new AssertionError(); | ||
} | ||
|
||
@Invoker | ||
static boolean callIsRaiderEntity(BlockPos pos, LivingEntity entity) { | ||
throw new AssertionError(); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
StaffMod/src/main/java/opekope2/avm_staff/mixin/SculkShriekerBlockEntityMixin.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,41 @@ | ||
/* | ||
* AvM Staff Mod | ||
* Copyright (c) 2024 opekope2 | ||
* | ||
* This mod is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This mod is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this mod. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package opekope2.avm_staff.mixin; | ||
|
||
import net.minecraft.block.entity.SculkShriekerBlockEntity; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.server.network.ServerPlayerEntity; | ||
import opekope2.avm_staff.api.entity.CakeEntity; | ||
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.CallbackInfoReturnable; | ||
|
||
@Mixin(SculkShriekerBlockEntity.class) | ||
public abstract class SculkShriekerBlockEntityMixin { | ||
@Inject(method = "findResponsiblePlayerFromEntity", at = @At("TAIL"), cancellable = true) | ||
private static void findResponsiblePlayerFromCake(Entity entity, CallbackInfoReturnable<ServerPlayerEntity> cir) { | ||
if (entity instanceof CakeEntity cake) { | ||
Entity owner = cake.getOwner(); | ||
if (owner instanceof ServerPlayerEntity player) { | ||
cir.setReturnValue(player); | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.