Compare commits
2 Commits
fb3ca6bdfe
...
c092414565
Author | SHA1 | Date |
---|---|---|
|
c092414565 | |
|
e117a7e25c |
|
@ -54,6 +54,8 @@ public class ModConfig {
|
|||
"Allows crafting coal and redstone as blocks for better storage");
|
||||
public static final Option<Boolean> DISABLE_EATING_WHEN_MAX_HP = make("Disable eating when at max HP", false,
|
||||
"Makes it so players can no longer eat if they're at max HP so they don't accidently waste food");
|
||||
public static final Option<Double> APPLE_DROP_RATE = make("Apple Drop Rate", 0.0,
|
||||
"Chance for apples to drop from leaves (decimal between 0.0 and 1.0)");
|
||||
|
||||
public static final Option<Boolean> FIX_BOW_MODEL = make("Fix bow model", true,
|
||||
"Makes the box model held by players and skeletons bigger and facing forward");
|
||||
|
|
|
@ -115,7 +115,7 @@ public class WyHelper {
|
|||
// player.dropItem(new ItemInstance(Tile.SLAB, 64));
|
||||
// player.dropItem(new ItemInstance(ItemType.minecart, 1));
|
||||
// player.dropItem(new ItemInstance(ItemType.minecartFurnace, 1));
|
||||
player.dropItem(new ItemInstance(ItemType.bow, 1));
|
||||
player.dropItem(new ItemInstance(ItemType.bucket, 1));
|
||||
// player.dropItem(new ItemInstance(Tile.GOLDEN_RAIL, 64));
|
||||
// player.dropItem(new ItemInstance(Tile.COBBLESTONE, 64));
|
||||
|
||||
|
|
|
@ -23,8 +23,22 @@ public class FurnaceEntityMixin {
|
|||
@Shadow
|
||||
private ItemInstance[] contents;
|
||||
|
||||
private int nextRandomTick = 20;
|
||||
|
||||
@Inject(method = "tick", at = @At("HEAD"))
|
||||
public void tickHead(CallbackInfo ci) {
|
||||
FurnaceEntity tileEntity = ((FurnaceEntity)(Object)this);
|
||||
if (ModConfig.ADD_MORE_SOUNDS.get() && tileEntity.cookTime > 0) {
|
||||
if (tileEntity.level.getLevelTime() % this.nextRandomTick == 0) {
|
||||
float pitch = 0.5f + tileEntity.level.rand.nextFloat() / 1.5f;
|
||||
tileEntity.level.playSound(tileEntity.x, tileEntity.y, tileEntity.z, "sound3.liquid.lavapop", 0.4f, pitch);
|
||||
this.nextRandomTick = 20 + tileEntity.level.rand.nextInt(20);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/FurnaceEntity;getFuelTime(Lnet/minecraft/item/ItemInstance;)I", shift = At.Shift.BY, by = 5), cancellable = true)
|
||||
public void tick(CallbackInfo ci) {
|
||||
public void tick(CallbackInfo ci) {
|
||||
if(ModConfig.FIX_FURNACE_LAVA_BUCKET.get()) {
|
||||
if(this.contents[1] != null && this.contents[1].itemId == ItemType.bucketLava.id) {
|
||||
ci.cancel();
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
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.ItemEntity;
|
||||
import net.minecraft.entity.player.Player;
|
||||
import net.minecraft.item.ItemInstance;
|
||||
import net.minecraft.item.ItemType;
|
||||
import net.minecraft.level.Level;
|
||||
import net.minecraft.tile.LeavesTile;
|
||||
import xyz.pixelatedw.finalbeta.ModConfig;
|
||||
|
||||
@Mixin(LeavesTile.class)
|
||||
public class LeavesTileMixin {
|
||||
@Inject(method = "afterBreak", at = @At(value = "INVOKE", target = "Lnet/minecraft/tile/FancyTile;afterBreak(Lnet/minecraft/level/Level;Lnet/minecraft/entity/player/Player;IIII)V"))
|
||||
public void afterBreak(Level level, Player player, int x, int y, int z, int meta, CallbackInfo ci) {
|
||||
boolean dropItem = level.rand.nextDouble() <= ModConfig.APPLE_DROP_RATE.get();
|
||||
if (dropItem) {
|
||||
ItemEntity appleItem = new ItemEntity(level, x + 0.5, y - 0.5, z + 0.5, new ItemInstance(ItemType.apple));
|
||||
appleItem.pickupDelay = 20;
|
||||
level.spawnEntity(appleItem);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
package xyz.pixelatedw.finalbeta.mixin;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
|
||||
import net.minecraft.client.util.ResourceDownloadThread;
|
||||
|
||||
|
@ -9,8 +11,8 @@ public class ResourceDownloadThreadMixin {
|
|||
|
||||
private static final String RESOURCES_URL = "http://mcresources.modification-station.net/MinecraftResources/";
|
||||
|
||||
// @ModifyConstant(method = "run", constant = @Constant(stringValue = "http://s3.amazonaws.com/MinecraftResources/"), remap = false)
|
||||
// private String getResourcesUrl(String def) {
|
||||
// return RESOURCES_URL;
|
||||
// }
|
||||
@ModifyConstant(method = "run", constant = @Constant(stringValue = "http://s3.amazonaws.com/MinecraftResources/"), remap = false)
|
||||
private String getResourcesUrl(String def) {
|
||||
return RESOURCES_URL;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package xyz.pixelatedw.finalbeta.mixin;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
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.level.Level;
|
||||
import net.minecraft.tile.StillFluidTile;
|
||||
import net.minecraft.tile.material.Material;
|
||||
|
||||
@Mixin(StillFluidTile.class)
|
||||
public class StillFluidTileMixin {
|
||||
@Inject(method = "onScheduledTick", at = @At("HEAD"))
|
||||
public void onScheduledTick(Level level, int x, int y, int z, Random random, CallbackInfo ci) {
|
||||
StillFluidTile tile = ((StillFluidTile) (Object) this);
|
||||
if (tile.material == Material.LAVA) {
|
||||
if (level.rand.nextBoolean()) {
|
||||
level.playSound(x, y, z, "sound3.liquid.lava", 0.5f, 1.0f);
|
||||
} else {
|
||||
level.playSound(x, y, z, "sound3.liquid.lavapop", 0.5f, 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -47,7 +47,9 @@
|
|||
"RecipeRegistryAccessor",
|
||||
"FoodItemMixin",
|
||||
"ItemTypeAccessor",
|
||||
"PressurePlateTileMixin"
|
||||
"PressurePlateTileMixin",
|
||||
"LeavesTileMixin",
|
||||
"StillFluidTileMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": -1
|
||||
|
|
Loading…
Reference in New Issue