Fixed saddled pigs not dropping their saddles on death and slightly adjusted the minecart's hitbox again
parent
687251779a
commit
6a3de4f59d
10
README.md
10
README.md
|
@ -168,6 +168,16 @@ After:
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
<details><summary>Fixes saddled pigs not dropping their saddles on death</summary>
|
||||||
|
|
||||||
|
Before:
|
||||||
|
![pig not dropping its saddle on death](https://i.imgur.com/PVLRNn5.mp4)
|
||||||
|
|
||||||
|
After:
|
||||||
|
![pig dropping its saddle on death](https://i.imgur.com/0yHHfxB.mp4)
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
**Q: My achievements screen is all messed up**
|
**Q: My achievements screen is all messed up**
|
||||||
|
|
|
@ -31,7 +31,9 @@ public class ModConfig {
|
||||||
"Fixes pickaxes not being effective agaist certain blocks that it should be effective on");
|
"Fixes pickaxes not being effective agaist certain blocks that it should be effective on");
|
||||||
public static final Option<Boolean> FIX_AXE_EFFECTIVENESS = make("Fix axe effectiveness", true,
|
public static final Option<Boolean> FIX_AXE_EFFECTIVENESS = make("Fix axe effectiveness", true,
|
||||||
"Fixes axes not being effective agaist certain blocks that it should be effective on");
|
"Fixes axes not being effective agaist certain blocks that it should be effective on");
|
||||||
|
public static final Option<Boolean> FIX_SADDLES_NOT_DROPPING = make("Fix saddles not dropping", true,
|
||||||
|
"Fixes saddles not dropping when killing saddled pigs");
|
||||||
|
|
||||||
private static ModConfig instance = new ModConfig();
|
private static ModConfig instance = new ModConfig();
|
||||||
public static final ModConfig instance() {
|
public static final ModConfig instance() {
|
||||||
return instance;
|
return instance;
|
||||||
|
|
|
@ -23,11 +23,10 @@ public class WyHelper {
|
||||||
public static void cheatCommand(Player player) {
|
public static void cheatCommand(Player player) {
|
||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
// player.level.playSound(player, "random.break", 1, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);
|
// player.level.playSound(player, "random.break", 1, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);
|
||||||
|
|
||||||
// player.damage(player, 15);
|
|
||||||
|
|
||||||
// player.dropItem(new ItemInstance(ItemType.mushroomStew, 1), false);
|
|
||||||
|
|
||||||
|
// player.dropItem(new ItemInstance(ItemType.saddle, 1), false);
|
||||||
|
// player.dropItem(new ItemInstance(ItemType.pickaxeGold, 1), false);
|
||||||
|
//
|
||||||
// player.dropItem(new ItemInstance(ItemType.bow, 1), false);
|
// player.dropItem(new ItemInstance(ItemType.bow, 1), false);
|
||||||
// player.dropItem(new ItemInstance(ItemType.arrow, 64), false);
|
// player.dropItem(new ItemInstance(ItemType.arrow, 64), false);
|
||||||
// player.dropItem(new ItemInstance(Tile.STONE, 64), false);
|
// player.dropItem(new ItemInstance(Tile.STONE, 64), false);
|
||||||
|
@ -42,9 +41,6 @@ public class WyHelper {
|
||||||
// enemy.setPositionAndAngles(player.x + 2, player.y, player.z, 0.0f, 0.0f);
|
// enemy.setPositionAndAngles(player.x + 2, player.y, player.z, 0.0f, 0.0f);
|
||||||
// player.level.spawnEntity(enemy);
|
// player.level.spawnEntity(enemy);
|
||||||
|
|
||||||
// boolean b = ModConfig.instance().get(ModConfig.SUGAR_CANE_ON_SAND);
|
|
||||||
// System.out.println(b);
|
|
||||||
|
|
||||||
player.level.setLevelTime(0);
|
player.level.setLevelTime(0);
|
||||||
player.level.getProperties().setRaining(false);
|
player.level.getProperties().setRaining(false);
|
||||||
player.level.getProperties().setRainTime(0);
|
player.level.getProperties().setRainTime(0);
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package xyz.pixelatedw.finalbeta.mixin;
|
||||||
|
|
||||||
|
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 net.minecraft.entity.LivingEntity;
|
||||||
|
import net.minecraft.entity.animal.Pig;
|
||||||
|
import net.minecraft.item.ItemType;
|
||||||
|
import xyz.pixelatedw.finalbeta.ModConfig;
|
||||||
|
|
||||||
|
@Mixin(LivingEntity.class)
|
||||||
|
public class LivingEntityMixin {
|
||||||
|
|
||||||
|
@Inject(method = "dropLoot", at = @At("TAIL"))
|
||||||
|
public void dropLoot(CallbackInfo ci) {
|
||||||
|
if(ModConfig.FIX_SADDLES_NOT_DROPPING.get()) {
|
||||||
|
LivingEntity entity = (LivingEntity) (Object) this;
|
||||||
|
if (entity instanceof Pig && ((Pig) entity).isSaddled()) {
|
||||||
|
entity.dropItem(ItemType.saddle.id, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -19,8 +19,8 @@ import xyz.pixelatedw.finalbeta.WyHelper;
|
||||||
@Mixin(Minecart.class)
|
@Mixin(Minecart.class)
|
||||||
public class MinecartMixin {
|
public class MinecartMixin {
|
||||||
|
|
||||||
private static final double EXTRA_MINECART_XZ_SIZE = 0.3;
|
private static final double EXTRA_MINECART_XZ_SIZE = 0.4;
|
||||||
private static final double EXTRA_MINECART_Y_SIZE = 0.1;
|
private static final double EXTRA_MINECART_Y_SIZE = 0.0;
|
||||||
|
|
||||||
@Inject(method = "method_1379", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "method_1379", at = @At("HEAD"), cancellable = true)
|
||||||
public void onCollision(Entity other, CallbackInfoReturnable<Box> ci) {
|
public void onCollision(Entity other, CallbackInfoReturnable<Box> ci) {
|
||||||
|
|
|
@ -22,7 +22,8 @@
|
||||||
"MinecartMixin",
|
"MinecartMixin",
|
||||||
"LivingEntityRendererMixin",
|
"LivingEntityRendererMixin",
|
||||||
"FishHookMixin",
|
"FishHookMixin",
|
||||||
"TileRendererMixin"
|
"TileRendererMixin",
|
||||||
|
"LivingEntityMixin"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
|
Loading…
Reference in New Issue