Sign editing + allowing them to be placed on chests
parent
b3f268efe2
commit
dd1e18a91c
|
@ -9,6 +9,6 @@ plasma_build=22
|
|||
api_version=1.1.0.1
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.3.0
|
||||
mod_version = 1.4.0
|
||||
maven_group = xyz.pixelatedw.finalbeta
|
||||
archives_base_name = finalbeta
|
||||
|
|
|
@ -56,6 +56,7 @@ public class ModConfig {
|
|||
"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> EDIT_SIGNS = make("Edit Signs", true, "Enables sign editing");
|
||||
|
||||
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");
|
||||
|
@ -108,8 +109,6 @@ public class ModConfig {
|
|||
this.fileConfig.setComment(o.name, o.description);
|
||||
}
|
||||
}
|
||||
|
||||
this.fileConfig.close();
|
||||
}
|
||||
|
||||
public static <T> Option<T> make(String name, T defaultValue, String description) {
|
||||
|
|
|
@ -9,8 +9,8 @@ import java.util.HashMap;
|
|||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.Player;
|
||||
import net.minecraft.item.ItemInstance;
|
||||
import net.minecraft.item.ItemType;
|
||||
import net.minecraft.recipe.RecipeRegistry;
|
||||
import net.minecraft.tile.Tile;
|
||||
import xyz.pixelatedw.finalbeta.mixin.RecipeRegistryAccessor;
|
||||
|
||||
public class WyHelper {
|
||||
|
@ -115,8 +115,8 @@ 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(Tile.FENCE, 1));
|
||||
player.dropItem(new ItemInstance(Tile.STONE_SLAB, 1, 2));
|
||||
player.dropItem(new ItemInstance(ItemType.sign));
|
||||
// player.dropItem(new ItemInstance(Tile.STONE_SLAB, 1, 2));
|
||||
// player.dropItem(new ItemInstance(Tile.GOLDEN_RAIL, 64));
|
||||
// player.dropItem(new ItemInstance(Tile.COBBLESTONE, 64));
|
||||
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
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.CallbackInfoReturnable;
|
||||
|
||||
import net.minecraft.client.ClientInteractionManager;
|
||||
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.Tile;
|
||||
import net.minecraft.tile.entity.Sign;
|
||||
import xyz.pixelatedw.finalbeta.ModConfig;
|
||||
|
||||
@Mixin(ClientInteractionManager.class)
|
||||
public class ClientInteractionManagerMixin {
|
||||
@Inject(method = "activateTile", at = @At("HEAD"), cancellable = true)
|
||||
public void activateTile(Player player, Level level, ItemInstance heldItem, int x, int y, int z, int meta, CallbackInfoReturnable<Boolean> cir) {
|
||||
int tileId = level.getTileId(x, y, z);
|
||||
if (ModConfig.EDIT_SIGNS.get()) {
|
||||
boolean isSign = tileId == Tile.STANDING_SIGN.id || tileId == Tile.WALL_SIGN.id;
|
||||
// method_1373 = sneaking check
|
||||
if (isSign && player.method_1373()) {
|
||||
Sign signTile = (Sign) level.getTileEntity(x, y, z);
|
||||
player.openSignScreen(signTile);
|
||||
cir.setReturnValue(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (heldItem != null && heldItem.itemId == ItemType.sign.id && tileId == Tile.CHEST.id) {
|
||||
cir.setReturnValue(heldItem.useOnTile(player, level, x, y, z, meta));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,8 +1,6 @@
|
|||
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;
|
||||
|
||||
|
@ -11,8 +9,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;
|
||||
// }
|
||||
}
|
|
@ -17,7 +17,7 @@ public class StillFluidTileMixin {
|
|||
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()) {
|
||||
if (level.rand.nextInt(10) == 1) {
|
||||
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);
|
||||
|
|
|
@ -50,7 +50,8 @@
|
|||
"PressurePlateTileMixin",
|
||||
"LeavesTileMixin",
|
||||
"StillFluidTileMixin",
|
||||
"FlowingFluidTileMixin"
|
||||
"FlowingFluidTileMixin",
|
||||
"ClientInteractionManagerMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": -1
|
||||
|
|
Loading…
Reference in New Issue