+ Today's work: Recipes & advancements, mainly
This commit is contained in:
parent
11c55a28fc
commit
38cd84208e
|
|
@ -5,10 +5,13 @@
|
|||
package net.montoyo.wd;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.fml.server.FMLServerHandler;
|
||||
import net.montoyo.mcef.utilities.Log;
|
||||
import net.montoyo.wd.core.HasAdvancement;
|
||||
import net.montoyo.wd.core.JSServerRequest;
|
||||
import net.montoyo.wd.data.GuiData;
|
||||
import net.montoyo.wd.entity.TileEntityScreen;
|
||||
|
|
@ -17,6 +20,8 @@ import net.montoyo.wd.utilities.NameUUIDPair;
|
|||
import net.montoyo.wd.utilities.Vector2i;
|
||||
import net.montoyo.wd.utilities.Vector3i;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class SharedProxy {
|
||||
|
||||
public static final int CURRENT_DIMENSION = Integer.MAX_VALUE;
|
||||
|
|
@ -74,4 +79,13 @@ public class SharedProxy {
|
|||
Log.error("Called SharedProxy.handleJSResponseError() on server side...");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public HasAdvancement hasClientPlayerAdvancement(@Nonnull ResourceLocation rl) {
|
||||
return HasAdvancement.DONT_KNOW;
|
||||
}
|
||||
|
||||
public MinecraftServer getServer() {
|
||||
return FMLServerHandler.instance().getServer();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,12 +4,17 @@
|
|||
|
||||
package net.montoyo.wd;
|
||||
|
||||
import net.minecraft.advancements.Advancement;
|
||||
import net.minecraft.advancements.CriteriaTriggers;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
|
|
@ -21,15 +26,14 @@ import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
|||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.montoyo.wd.block.BlockKeyboardRight;
|
||||
import net.montoyo.wd.block.BlockPeripheral;
|
||||
import net.montoyo.wd.block.BlockScreen;
|
||||
import net.montoyo.wd.core.Criterion;
|
||||
import net.montoyo.wd.core.DefaultPeripheral;
|
||||
import net.montoyo.wd.core.WDCreativeTab;
|
||||
import net.montoyo.wd.core.*;
|
||||
import net.montoyo.wd.entity.TileEntityScreen;
|
||||
import net.montoyo.wd.item.*;
|
||||
import net.montoyo.wd.net.Messages;
|
||||
|
|
@ -56,6 +60,7 @@ public class WebDisplays {
|
|||
|
||||
public static SimpleNetworkWrapper NET_HANDLER;
|
||||
public static WDCreativeTab CREATIVE_TAB;
|
||||
public static final ResourceLocation ADV_PAD_BREAK = new ResourceLocation("webdisplays", "webdisplays/pad_break");
|
||||
|
||||
//Blocks
|
||||
public BlockScreen blockScreen;
|
||||
|
|
@ -70,6 +75,7 @@ public class WebDisplays {
|
|||
public ItemUpgrade itemUpgrade;
|
||||
public ItemLaserPointer itemLaserPointer;
|
||||
public ItemCraftComponent itemCraftComp;
|
||||
public ItemMulti itemAdvIcon;
|
||||
|
||||
//Sounds
|
||||
public SoundEvent soundTyping;
|
||||
|
|
@ -79,6 +85,9 @@ public class WebDisplays {
|
|||
|
||||
//Criterions
|
||||
public Criterion criterionPadBreak;
|
||||
public Criterion criterionUpgradeScreen;
|
||||
public Criterion criterionLinkPeripheral;
|
||||
public Criterion criterionKeyboardCat;
|
||||
|
||||
//Config
|
||||
public static final double PAD_RATIO = 59.0 / 30.0;
|
||||
|
|
@ -86,6 +95,7 @@ public class WebDisplays {
|
|||
public double padResX;
|
||||
public double padResY;
|
||||
private int lastPadId = 0;
|
||||
public boolean doHardRecipe = true;
|
||||
|
||||
@Mod.EventHandler
|
||||
public void onPreInit(FMLPreInitializationEvent ev) {
|
||||
|
|
@ -93,7 +103,10 @@ public class WebDisplays {
|
|||
|
||||
//Criterions
|
||||
criterionPadBreak = new Criterion("pad_break");
|
||||
registerTrigger(criterionPadBreak);
|
||||
criterionUpgradeScreen = new Criterion("upgrade_screen");
|
||||
criterionLinkPeripheral = new Criterion("link_peripheral");
|
||||
criterionKeyboardCat = new Criterion("keyboard_cat");
|
||||
registerTrigger(criterionPadBreak, criterionUpgradeScreen, criterionLinkPeripheral, criterionKeyboardCat);
|
||||
|
||||
//Read configuration TODO
|
||||
final int padHeight = 480;
|
||||
|
|
@ -118,6 +131,10 @@ public class WebDisplays {
|
|||
itemLaserPointer = new ItemLaserPointer();
|
||||
itemCraftComp = new ItemCraftComponent();
|
||||
|
||||
itemAdvIcon = new ItemMulti(AdvancementIcon.class);
|
||||
itemAdvIcon.setUnlocalizedName("webdisplays.advicon");
|
||||
itemAdvIcon.setRegistryName("advicon");
|
||||
|
||||
PROXY.preInit();
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
|
@ -150,7 +167,7 @@ public class WebDisplays {
|
|||
@SubscribeEvent
|
||||
public void onRegisterItems(RegistryEvent.Register<Item> ev) {
|
||||
ev.getRegistry().registerAll(blockScreen.getItem(), blockPeripheral.getItem());
|
||||
ev.getRegistry().registerAll(itemScreenCfg, itemOwnerThief, itemLinker, itemMinePad, itemUpgrade, itemLaserPointer, itemCraftComp);
|
||||
ev.getRegistry().registerAll(itemScreenCfg, itemOwnerThief, itemLinker, itemMinePad, itemUpgrade, itemLaserPointer, itemCraftComp, itemAdvIcon);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
|
@ -225,6 +242,27 @@ public class WebDisplays {
|
|||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerCraft(PlayerEvent.ItemCraftedEvent ev) {
|
||||
if(doHardRecipe && ev.crafting.getItem() == itemCraftComp && ev.crafting.getMetadata() == CraftComponent.EXTENSION_CARD.ordinal()) {
|
||||
if((ev.player instanceof EntityPlayerMP && !hasPlayerAdvancement((EntityPlayerMP) ev.player, ADV_PAD_BREAK)) || PROXY.hasClientPlayerAdvancement(ADV_PAD_BREAK) != HasAdvancement.YES) {
|
||||
ev.crafting.setItemDamage(CraftComponent.BAD_EXTENSION_CARD.ordinal());
|
||||
|
||||
if(!ev.player.world.isRemote)
|
||||
ev.player.world.playSound(null, ev.player.posX, ev.player.posY, ev.player.posZ, SoundEvents.ENTITY_ITEM_BREAK, SoundCategory.MASTER, 1.0f, 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean hasPlayerAdvancement(EntityPlayerMP ply, ResourceLocation rl) {
|
||||
MinecraftServer server = PROXY.getServer();
|
||||
if(server == null)
|
||||
return false;
|
||||
|
||||
Advancement adv = server.getAdvancementManager().getAdvancement(rl);
|
||||
return adv != null && ply.getAdvancements().getProgress(adv).isDone();
|
||||
}
|
||||
|
||||
public static int getNextAvailablePadID() {
|
||||
return INSTANCE.lastPadId++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -151,6 +151,8 @@ public class BlockScreen extends WDBlockContainer {
|
|||
heldItem.shrink(1);
|
||||
|
||||
Util.toast(player, TextFormatting.AQUA, "upgradeOk");
|
||||
if(player instanceof EntityPlayerMP)
|
||||
WebDisplays.INSTANCE.criterionUpgradeScreen.trigger(((EntityPlayerMP) player).getAdvancements());
|
||||
} else
|
||||
Util.toast(player, "upgradeError");
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,12 @@
|
|||
package net.montoyo.wd.client;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.advancements.Advancement;
|
||||
import net.minecraft.advancements.AdvancementProgress;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.multiplayer.ClientAdvancementManager;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.client.resources.IResourceManager;
|
||||
|
|
@ -17,9 +20,11 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.EnumHandSide;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
|
@ -41,17 +46,19 @@ import net.montoyo.wd.client.gui.GuiSetURL2;
|
|||
import net.montoyo.wd.client.gui.WDScreen;
|
||||
import net.montoyo.wd.client.gui.loading.GuiLoader;
|
||||
import net.montoyo.wd.client.renderers.*;
|
||||
import net.montoyo.wd.core.CraftComponent;
|
||||
import net.montoyo.wd.core.DefaultUpgrade;
|
||||
import net.montoyo.wd.core.HasAdvancement;
|
||||
import net.montoyo.wd.core.JSServerRequest;
|
||||
import net.montoyo.wd.data.GuiData;
|
||||
import net.montoyo.wd.entity.TileEntityScreen;
|
||||
import net.montoyo.wd.item.ItemMulti;
|
||||
import net.montoyo.wd.net.SMessagePadCtrl;
|
||||
import net.montoyo.wd.net.SMessageScreenCtrl;
|
||||
import net.montoyo.wd.utilities.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import javax.annotation.Nonnull;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.*;
|
||||
|
||||
public class ClientProxy extends SharedProxy implements IResourceManagerReloadListener, IDisplayHandler, IJSQueryHandler {
|
||||
|
||||
|
|
@ -77,6 +84,7 @@ public class ClientProxy extends SharedProxy implements IResourceManagerReloadLi
|
|||
private MinePadRenderer minePadRenderer;
|
||||
private JSQueryDispatcher jsDispatcher;
|
||||
private LaserPointerRenderer laserPointerRenderer;
|
||||
private Field advancementToProgress;
|
||||
|
||||
//Laser pointer
|
||||
private TileEntityScreen pointedScreen;
|
||||
|
|
@ -121,6 +129,7 @@ public class ClientProxy extends SharedProxy implements IResourceManagerReloadLi
|
|||
|
||||
mcef.registerDisplayHandler(this);
|
||||
mcef.registerJSQueryHandler(this);
|
||||
findAdvancementToProgressField();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -202,6 +211,46 @@ public class ClientProxy extends SharedProxy implements IResourceManagerReloadLi
|
|||
mc.displayGuiScreen(new GuiMinePad(pd));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public HasAdvancement hasClientPlayerAdvancement(@Nonnull ResourceLocation rl) {
|
||||
if(advancementToProgress != null && mc.player != null && mc.player.connection != null) {
|
||||
ClientAdvancementManager cam = mc.player.connection.getAdvancementManager();
|
||||
Advancement adv = cam.getAdvancementList().getAdvancement(rl);
|
||||
Map map;
|
||||
|
||||
if(adv == null)
|
||||
return HasAdvancement.DONT_KNOW;
|
||||
|
||||
try {
|
||||
map = (Map) advancementToProgress.get(cam);
|
||||
} catch(Throwable t) {
|
||||
t.printStackTrace();
|
||||
advancementToProgress = null;
|
||||
return HasAdvancement.DONT_KNOW;
|
||||
}
|
||||
|
||||
Object progress = map.get(adv);
|
||||
if(progress == null)
|
||||
return HasAdvancement.NO;
|
||||
|
||||
if(!(progress instanceof AdvancementProgress)) {
|
||||
Log.warning("The ClientAdvancementManager.advancementToProgress map does not contain AdvancementProgress instances");
|
||||
advancementToProgress = null; //It's wrong
|
||||
return HasAdvancement.DONT_KNOW;
|
||||
}
|
||||
|
||||
return ((AdvancementProgress) progress).isDone() ? HasAdvancement.YES : HasAdvancement.NO;
|
||||
}
|
||||
|
||||
return HasAdvancement.DONT_KNOW;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MinecraftServer getServer() {
|
||||
return mc.getIntegratedServer();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleJSResponseSuccess(int reqId, JSServerRequest type, byte[] data) {
|
||||
JSQueryDispatcher.ServerQuery q = jsDispatcher.fulfillQuery(reqId);
|
||||
|
|
@ -341,14 +390,9 @@ public class ClientProxy extends SharedProxy implements IResourceManagerReloadLi
|
|||
registerItemModel(wd.itemMinePad, 0, "normal");
|
||||
registerItemModel(wd.itemMinePad, 1, "normal");
|
||||
registerItemModel(wd.itemLaserPointer, 0, "normal");
|
||||
|
||||
DefaultUpgrade[] upgrades = DefaultUpgrade.values();
|
||||
for(int i = 0; i < upgrades.length; i++)
|
||||
ModelLoader.setCustomModelResourceLocation(wd.itemUpgrade, i, new ModelResourceLocation("webdisplays:upgrade_" + upgrades[i].getName(), "normal"));
|
||||
|
||||
CraftComponent[] components = CraftComponent.values();
|
||||
for(int i = 0; i < components.length; i++)
|
||||
ModelLoader.setCustomModelResourceLocation(wd.itemCraftComp, i, new ModelResourceLocation("webdisplays:craftcomp_" + components[i].getName(), "normal"));
|
||||
registerItemMultiModels(wd.itemUpgrade);
|
||||
registerItemMultiModels(wd.itemCraftComp);
|
||||
registerItemMultiModels(wd.itemAdvIcon);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
|
|
@ -535,6 +579,13 @@ public class ClientProxy extends SharedProxy implements IResourceManagerReloadLi
|
|||
ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), variant));
|
||||
}
|
||||
|
||||
private void registerItemMultiModels(ItemMulti item) {
|
||||
Enum[] values = item.getEnumValues();
|
||||
|
||||
for(int i = 0; i < values.length; i++)
|
||||
ModelLoader.setCustomModelResourceLocation(item, i, new ModelResourceLocation(item.getRegistryName().toString() + '_' + values[i], "normal"));
|
||||
}
|
||||
|
||||
private void updatePad(int id, NBTTagCompound tag, boolean isSelected) {
|
||||
PadData pd = padMap.get(id);
|
||||
|
||||
|
|
@ -582,4 +633,20 @@ public class ClientProxy extends SharedProxy implements IResourceManagerReloadLi
|
|||
return false;
|
||||
}
|
||||
|
||||
private void findAdvancementToProgressField() {
|
||||
Field[] fields = ClientAdvancementManager.class.getDeclaredFields();
|
||||
|
||||
Arrays.stream(fields).filter(f -> f.getType() == Map.class).findAny().ifPresent(f -> {
|
||||
try {
|
||||
f.setAccessible(true);
|
||||
advancementToProgress = f;
|
||||
} catch(Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
});
|
||||
|
||||
if(advancementToProgress == null)
|
||||
Log.warning("ClientAdvancementManager.advancementToProgress field could not be found");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
24
src/main/java/net/montoyo/wd/core/AdvancementIcon.java
Normal file
24
src/main/java/net/montoyo/wd/core/AdvancementIcon.java
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Copyright (C) 2018 BARBOTIN Nicolas
|
||||
*/
|
||||
|
||||
package net.montoyo.wd.core;
|
||||
|
||||
public enum AdvancementIcon {
|
||||
|
||||
WEB_DISPLAYS("wd"),
|
||||
BROKEN_PAD("brokenpad"),
|
||||
PIGEON("pigeon");
|
||||
|
||||
private final String name;
|
||||
|
||||
AdvancementIcon(String n) {
|
||||
name = n;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -4,6 +4,9 @@
|
|||
|
||||
package net.montoyo.wd.core;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.montoyo.wd.WebDisplays;
|
||||
|
||||
public enum CraftComponent {
|
||||
|
||||
STONE_KEY("stonekey"),
|
||||
|
|
@ -12,7 +15,9 @@ public enum CraftComponent {
|
|||
BATTERY_CELL("batcell"),
|
||||
BATTERY_PACK("batpack"),
|
||||
LASER_DIODE("laserdiode"),
|
||||
BACKLIGHT("backlight");
|
||||
BACKLIGHT("backlight"),
|
||||
EXTENSION_CARD("extcard"),
|
||||
BAD_EXTENSION_CARD("badextcard");
|
||||
|
||||
private final String name;
|
||||
|
||||
|
|
@ -20,8 +25,13 @@ public enum CraftComponent {
|
|||
name = n;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public ItemStack makeItemStack() {
|
||||
return new ItemStack(WebDisplays.INSTANCE.itemCraftComp, 1, ordinal());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ public enum DefaultUpgrade {
|
|||
name = n;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
|
|
|||
13
src/main/java/net/montoyo/wd/core/HasAdvancement.java
Normal file
13
src/main/java/net/montoyo/wd/core/HasAdvancement.java
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/*
|
||||
* Copyright (C) 2018 BARBOTIN Nicolas
|
||||
*/
|
||||
|
||||
package net.montoyo.wd.core;
|
||||
|
||||
public enum HasAdvancement {
|
||||
|
||||
DONT_KNOW,
|
||||
YES,
|
||||
NO
|
||||
|
||||
}
|
||||
|
|
@ -5,9 +5,11 @@
|
|||
package net.montoyo.wd.entity;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.passive.EntityOcelot;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.montoyo.wd.WebDisplays;
|
||||
import net.montoyo.wd.core.ScreenRights;
|
||||
import net.montoyo.wd.data.KeyboardData;
|
||||
import net.montoyo.wd.utilities.BlockSide;
|
||||
|
|
@ -59,6 +61,10 @@ public class TileEntityKeyboard extends TileEntityPeripheralBase {
|
|||
if(ok) {
|
||||
char rnd = RANDOM_CHARS.charAt((int) (Math.random() * ((double) RANDOM_CHARS.length())));
|
||||
tes.type(screenSide, "t" + rnd, pos);
|
||||
|
||||
EntityPlayer owner = world.getPlayerEntityByUUID(scr.owner.uuid);
|
||||
if(owner != null && owner instanceof EntityPlayerMP && ent instanceof EntityOcelot)
|
||||
WebDisplays.INSTANCE.criterionKeyboardCat.trigger(((EntityPlayerMP) owner).getAdvancements());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,54 +7,37 @@ package net.montoyo.wd.item;
|
|||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.montoyo.wd.WebDisplays;
|
||||
import net.montoyo.wd.core.CraftComponent;
|
||||
import net.montoyo.wd.core.HasAdvancement;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemCraftComponent extends Item {
|
||||
public class ItemCraftComponent extends ItemMulti {
|
||||
|
||||
public ItemCraftComponent() {
|
||||
super(CraftComponent.class);
|
||||
setUnlocalizedName("webdisplays.craftcomp");
|
||||
setRegistryName("craftcomp");
|
||||
setHasSubtypes(true);
|
||||
setMaxDamage(0);
|
||||
setCreativeTab(WebDisplays.CREATIVE_TAB);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
int meta = stack.getMetadata();
|
||||
CraftComponent[] names = CraftComponent.values();
|
||||
String ret = getUnlocalizedName();
|
||||
|
||||
if(meta >= 0 && meta < names.length)
|
||||
return ret + '.' + names[meta].getName();
|
||||
else
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> items) {
|
||||
if(isInCreativeTab(tab)) {
|
||||
int cnt = CraftComponent.values().length;
|
||||
|
||||
for(int i = 0; i < cnt; i++)
|
||||
items.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
//Hide the bad extension card from the creative tab
|
||||
creativeTabItems.clear(CraftComponent.BAD_EXTENSION_CARD.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack is, @Nullable World world, List<String> tt, ITooltipFlag ttFlags) {
|
||||
tt.add("" + ChatFormatting.ITALIC + I18n.format("item.webdisplays.craftcomp.name"));
|
||||
if(WebDisplays.INSTANCE.doHardRecipe && is.getMetadata() == CraftComponent.EXTENSION_CARD.ordinal() && WebDisplays.PROXY.hasClientPlayerAdvancement(WebDisplays.ADV_PAD_BREAK) != HasAdvancement.YES) {
|
||||
tt.add("" + ChatFormatting.RED + I18n.format("webdisplays.extcard.cantcraft1"));
|
||||
tt.add("" + ChatFormatting.RED + I18n.format("webdisplays.extcard.cantcraft2"));
|
||||
} else if(is.getMetadata() == CraftComponent.BAD_EXTENSION_CARD.ordinal())
|
||||
tt.add("" + ChatFormatting.RED + I18n.format("webdisplays.extcard.bad"));
|
||||
else
|
||||
tt.add("" + ChatFormatting.ITALIC + I18n.format("item.webdisplays.craftcomp.name"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import net.minecraft.block.state.IBlockState;
|
|||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
|
@ -73,9 +74,12 @@ public class ItemLinker extends Item {
|
|||
Vector3i tePos = new Vector3i(tag.getInteger("ScreenX"), tag.getInteger("ScreenY"), tag.getInteger("ScreenZ"));
|
||||
BlockSide scrSide = BlockSide.values()[tag.getByte("ScreenSide")];
|
||||
|
||||
if(target.connect(world, pos_, state, tePos, scrSide))
|
||||
if(target.connect(world, pos_, state, tePos, scrSide)) {
|
||||
Util.toast(player, TextFormatting.AQUA, "linked");
|
||||
else
|
||||
|
||||
if(player instanceof EntityPlayerMP)
|
||||
WebDisplays.INSTANCE.criterionLinkPeripheral.trigger(((EntityPlayerMP) player).getAdvancements());
|
||||
} else
|
||||
Util.toast(player, "linkError");
|
||||
|
||||
stack.setTagCompound(null);
|
||||
|
|
|
|||
|
|
@ -20,8 +20,9 @@ import net.minecraft.util.EnumHand;
|
|||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.world.World;
|
||||
import net.montoyo.wd.WebDisplays;
|
||||
import net.montoyo.wd.utilities.Log;
|
||||
import net.montoyo.wd.core.CraftComponent;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
|
@ -45,7 +46,8 @@ public class ItemMinePad2 extends Item {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer ply, EnumHand hand) {
|
||||
@Nonnull
|
||||
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer ply, @Nonnull EnumHand hand) {
|
||||
ItemStack is = ply.getHeldItem(hand);
|
||||
|
||||
if(world.isRemote) {
|
||||
|
|
@ -60,8 +62,11 @@ public class ItemMinePad2 extends Item {
|
|||
|
||||
@Override
|
||||
public void addInformation(ItemStack is, @Nullable World world, List<String> tt, ITooltipFlag ttFlags) {
|
||||
if(is == null || is.getTagCompound() == null || !is.getTagCompound().hasKey("PadID"))
|
||||
if(is.getTagCompound() == null || !is.getTagCompound().hasKey("PadID"))
|
||||
tt.add("" + ChatFormatting.ITALIC + ChatFormatting.GRAY + I18n.format("webdisplays.minepad.turnon"));
|
||||
|
||||
if(is.getMetadata() > 0)
|
||||
tt.add("" + ChatFormatting.RED + I18n.format("webdisplays.minepad2.info"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -86,11 +91,10 @@ public class ItemMinePad2 extends Item {
|
|||
|
||||
if(thrower != null && height - ent.posY >= 20.0) {
|
||||
ent.world.playSound(null, ent.posX, ent.posY, ent.posZ, SoundEvents.BLOCK_GLASS_BREAK, SoundCategory.BLOCKS, 4.0f, 1.0f);
|
||||
ent.world.spawnEntity(new EntityItem(ent.world, ent.posX, ent.posY, ent.posZ, CraftComponent.EXTENSION_CARD.makeItemStack()));
|
||||
ent.setDead();
|
||||
//TODO: Drop an extension card
|
||||
|
||||
EntityPlayer ply = ent.world.getPlayerEntityByUUID(thrower);
|
||||
|
||||
if(ply != null && ply instanceof EntityPlayerMP)
|
||||
WebDisplays.INSTANCE.criterionPadBreak.trigger(((EntityPlayerMP) ply).getAdvancements());
|
||||
}
|
||||
|
|
@ -101,6 +105,7 @@ public class ItemMinePad2 extends Item {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
String ret = getUnlocalizedName();
|
||||
if(stack.getMetadata() > 0)
|
||||
|
|
|
|||
54
src/main/java/net/montoyo/wd/item/ItemMulti.java
Normal file
54
src/main/java/net/montoyo/wd/item/ItemMulti.java
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* Copyright (C) 2018 BARBOTIN Nicolas
|
||||
*/
|
||||
|
||||
package net.montoyo.wd.item;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.BitSet;
|
||||
|
||||
public class ItemMulti extends Item {
|
||||
|
||||
protected final Enum[] values;
|
||||
protected final BitSet creativeTabItems;
|
||||
|
||||
public ItemMulti(Class<? extends Enum> cls) {
|
||||
values = cls.getEnumConstants();
|
||||
creativeTabItems = new BitSet(values.length);
|
||||
creativeTabItems.set(0, values.length);
|
||||
setHasSubtypes(true);
|
||||
setMaxDamage(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
int meta = stack.getMetadata();
|
||||
String ret = getUnlocalizedName();
|
||||
|
||||
if(meta >= 0 && meta < values.length)
|
||||
return ret + '.' + values[meta];
|
||||
else
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> items) {
|
||||
if(isInCreativeTab(tab)) {
|
||||
for(int i = 0; i < values.length; i++) {
|
||||
if(creativeTabItems.get(i))
|
||||
items.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Enum[] getEnumValues() {
|
||||
return values;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -7,11 +7,8 @@ package net.montoyo.wd.item;
|
|||
import com.mojang.realmsclient.gui.ChatFormatting;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.montoyo.wd.WebDisplays;
|
||||
import net.montoyo.wd.core.DefaultUpgrade;
|
||||
|
|
@ -23,13 +20,12 @@ import javax.annotation.Nonnull;
|
|||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemUpgrade extends Item implements IUpgrade {
|
||||
public class ItemUpgrade extends ItemMulti implements IUpgrade {
|
||||
|
||||
public ItemUpgrade() {
|
||||
super(DefaultUpgrade.class);
|
||||
setUnlocalizedName("webdisplays.upgrade");
|
||||
setRegistryName("upgrade");
|
||||
setHasSubtypes(true);
|
||||
setMaxDamage(0);
|
||||
setCreativeTab(WebDisplays.CREATIVE_TAB);
|
||||
}
|
||||
|
||||
|
|
@ -50,34 +46,11 @@ public class ItemUpgrade extends Item implements IUpgrade {
|
|||
return otherStack.getItem() == this && otherStack.getMetadata() == myStack.getMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nonnull
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
int meta = stack.getMetadata();
|
||||
DefaultUpgrade[] names = DefaultUpgrade.values();
|
||||
String ret = getUnlocalizedName();
|
||||
|
||||
if(meta >= 0 && meta < names.length)
|
||||
return ret + '.' + names[meta].getName();
|
||||
else
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack is, @Nullable World world, List<String> tt, ITooltipFlag ttFlags) {
|
||||
tt.add("" + ChatFormatting.ITALIC + I18n.format("item.webdisplays.upgrade.name"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(@Nonnull CreativeTabs tab, @Nonnull NonNullList<ItemStack> items) {
|
||||
if(isInCreativeTab(tab)) {
|
||||
int cnt = DefaultUpgrade.values().length;
|
||||
|
||||
for(int i = 0; i < cnt; i++)
|
||||
items.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getJSName(@Nonnull ItemStack is) {
|
||||
int meta = is.getMetadata();
|
||||
|
|
@ -86,7 +59,7 @@ public class ItemUpgrade extends Item implements IUpgrade {
|
|||
if(meta < 0 || meta >= upgrades.length)
|
||||
return "webdisplays:wtf";
|
||||
else
|
||||
return "webdisplays:" + upgrades[meta].getName();
|
||||
return "webdisplays:" + upgrades[meta];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"display": {
|
||||
"icon": { "item": "minecraft:skull", "data": 3, "nbt": "{SkullOwner:\"MHF_Ocelot\"}" },
|
||||
"title": { "translate": "advancements.webdisplays.keyboardcat.title" },
|
||||
"description": { "translate": "advancements.webdisplays.keyboardcat.description" }
|
||||
},
|
||||
"parent": "webdisplays:webdisplays/link_peripheral",
|
||||
"criteria": {
|
||||
"keyboard_cat": {
|
||||
"trigger": "webdisplays:keyboard_cat"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"display": {
|
||||
"icon": { "item": "webdisplays:laserpointer" },
|
||||
"title": { "translate": "advancements.webdisplays.laser.title" },
|
||||
"description": { "translate": "advancements.webdisplays.laser.description" }
|
||||
},
|
||||
"parent": "webdisplays:webdisplays/pad_break",
|
||||
"criteria": {
|
||||
"has_laser": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [ { "item": "webdisplays:laserpointer" } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"display": {
|
||||
"icon": { "item": "webdisplays:linker" },
|
||||
"title": { "translate": "advancements.webdisplays.linkperipheral.title" },
|
||||
"description": { "translate": "advancements.webdisplays.linkperipheral.description" }
|
||||
},
|
||||
"parent": "webdisplays:webdisplays/screen",
|
||||
"criteria": {
|
||||
"link_peripheral": {
|
||||
"trigger": "webdisplays:link_peripheral"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -9,8 +9,13 @@
|
|||
"has_glass_pane": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [ { "item": "webdisplays:minepad" } ]
|
||||
"items": [ { "item": "webdisplays:minepad", "data": 0 } ]
|
||||
}
|
||||
}
|
||||
},
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"webdisplays:minepad2"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"display": {
|
||||
"icon": { "item": "webdisplays:advicon", "data": 2 },
|
||||
"title": { "translate": "advancements.webdisplays.minepad2.title" },
|
||||
"description": { "translate": "advancements.webdisplays.minepad2.description" }
|
||||
},
|
||||
"parent": "webdisplays:webdisplays/minepad",
|
||||
"criteria": {
|
||||
"has_minepad2": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [ { "item": "webdisplays:minepad", "data": 1 } ]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"display": {
|
||||
"icon": { "item": "webdisplays:minepad" },
|
||||
"icon": { "item": "webdisplays:advicon", "data": 1 },
|
||||
"title": { "translate": "advancements.webdisplays.padbreak.title" },
|
||||
"description": { "translate": "advancements.webdisplays.padbreak.description" }
|
||||
},
|
||||
|
|
@ -9,5 +9,17 @@
|
|||
"pad_break": {
|
||||
"trigger": "webdisplays:pad_break"
|
||||
}
|
||||
},
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"webdisplays:extcard",
|
||||
"webdisplays:upgrade",
|
||||
"webdisplays:laserdiode",
|
||||
"webdisplays:laserpointer",
|
||||
"webdisplays:upgrade_gps",
|
||||
"webdisplays:upgrade_laser",
|
||||
"webdisplays:upgrade_redin",
|
||||
"webdisplays:upgrade_redout"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"display": {
|
||||
"icon": { "item": "webdisplays:screen" },
|
||||
"icon": { "item": "webdisplays:advicon", "data": 0 },
|
||||
"title": { "translate": "advancements.webdisplays.root.title" },
|
||||
"description": { "translate": "advancements.webdisplays.root.description" },
|
||||
"background": "minecraft:textures/gui/advancements/backgrounds/stone.png",
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
},
|
||||
"parent": "webdisplays:webdisplays/root",
|
||||
"criteria": {
|
||||
"has_glass_pane": {
|
||||
"has_screen": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [ { "item": "webdisplays:screen" } ]
|
||||
|
|
@ -17,11 +17,13 @@
|
|||
"recipes": [
|
||||
"webdisplays:linker",
|
||||
"webdisplays:screencfg",
|
||||
"webdisplays:peripheral",
|
||||
"webdisplays:rctrl",
|
||||
"webdisplays:ccinterface",
|
||||
"webdisplays:ocinterface",
|
||||
"webdisplays:redctrl1",
|
||||
"webdisplays:redctrl2"
|
||||
"webdisplays:redctrl2",
|
||||
"webdisplays:stonekey",
|
||||
"webdisplays:keyboard"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"display": {
|
||||
"icon": { "item": "webdisplays:craftcomp", "data": 1 },
|
||||
"title": { "translate": "advancements.webdisplays.upgrade.title" },
|
||||
"description": { "translate": "advancements.webdisplays.upgrade.description" }
|
||||
},
|
||||
"parent": "webdisplays:webdisplays/pad_break",
|
||||
"criteria": {
|
||||
"upgrade_screen": {
|
||||
"trigger": "webdisplays:upgrade_screen"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -17,6 +17,8 @@ item.webdisplays.craftcomp.batcell.name=Battery Cell
|
|||
item.webdisplays.craftcomp.batpack.name=Battery Pack
|
||||
item.webdisplays.craftcomp.laserdiode.name=650nm Laser Diode
|
||||
item.webdisplays.craftcomp.backlight.name=Backlight
|
||||
item.webdisplays.craftcomp.extcard.name=Extension Card
|
||||
item.webdisplays.craftcomp.badextcard.name=Bad Extension Card
|
||||
item.webdisplays.minepad.name=minePad
|
||||
item.webdisplays.minepad2.name=minePad 2
|
||||
item.webdisplays.upgrade.name=Screen Upgrade
|
||||
|
|
@ -25,6 +27,10 @@ item.webdisplays.upgrade.redinput.name=Redstone Input Port
|
|||
item.webdisplays.upgrade.redoutput.name=Redstone Output Port
|
||||
item.webdisplays.upgrade.gps.name=GPS Module
|
||||
item.webdisplays.laserpointer.name=Laser Pointer
|
||||
item.webdisplays.advicon.name=Advancement Icon
|
||||
item.webdisplays.advicon.wd.name=WebDisplays
|
||||
item.webdisplays.advicon.brokenpad.name=Broken minePad
|
||||
item.webdisplays.advicon.pigeon.name=Pigeon
|
||||
webdisplays.message.tooSmall=Too small! Minimum size is 2x2.
|
||||
webdisplays.message.invalid=Structure is invalid; look at %s.
|
||||
webdisplays.message.turnOn=You need to turn the screen on first!
|
||||
|
|
@ -42,7 +48,7 @@ webdisplays.message.missingCC=ComputerCraft is not available.
|
|||
webdisplays.message.missingOC=OpenComputers is not available.
|
||||
webdisplays.message.upgradeError=Upgrade error :( Check logs...
|
||||
webdisplays.message.upgradeOk=Upgrade installed!
|
||||
webdisplays.gui.screencfg.owner=Screen owner:
|
||||
webdisplays.gui.screencfg.owner=Screen owner:
|
||||
webdisplays.gui.screencfg.friends=Friends:
|
||||
webdisplays.gui.screencfg.permissions=Permissions:
|
||||
webdisplays.gui.screencfg.seturl=Change URL
|
||||
|
|
@ -64,6 +70,10 @@ webdisplays.gui.seturl.ok=OK
|
|||
webdisplays.gui.seturl.cancel=Cancel
|
||||
webdisplays.gui.seturl.shutdown=Shut down
|
||||
webdisplays.minepad.turnon=Sneak and right-click to turn on
|
||||
webdisplays.minepad2.info=NO REFUNDS!
|
||||
webdisplays.extcard.cantcraft1=You don't know enough yet.
|
||||
webdisplays.extcard.cantcraft2=You WILL FAIL at crafting this item.
|
||||
webdisplays.extcard.bad=Someone failed at crafting an extension card
|
||||
webdisplays.gui.keyboard.hooked=Keyboard hooked. Press escape to leave.
|
||||
webdisplays.gui.keyboard.warning1=WARNING! Typed data are sent in PLAIN TEXT to the server.
|
||||
webdisplays.gui.keyboard.warning2=This means anyone can know what you're up to.
|
||||
|
|
@ -79,3 +89,11 @@ advancements.webdisplays.padbreak.title=Reverse Engineering
|
|||
advancements.webdisplays.padbreak.description=These things are fragile! Don't drop a minePad from high place to unlock the upgrade recipes
|
||||
advancements.webdisplays.minepad2.title=Pigeon
|
||||
advancements.webdisplays.minepad2.description=Craft a minePad 2. Look, I know it's expensive, but that means it's better than anything else, right? ...right?
|
||||
advancements.webdisplays.linkperipheral.title=It's wireless!
|
||||
advancements.webdisplays.linkperipheral.description=Link a peripheral to a screen
|
||||
advancements.webdisplays.keyboardcat.title=DAMN CATS
|
||||
advancements.webdisplays.keyboardcat.description=Have an ocelot walk on your keyboard
|
||||
advancements.webdisplays.upgrade.title=More than a screen
|
||||
advancements.webdisplays.upgrade.description=Install your first upgrade
|
||||
advancements.webdisplays.laser.title=Don't aim the eyes
|
||||
advancements.webdisplays.laser.description=Craft a laser pointer!
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "webdisplays:items/advicon_brokenpad"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "webdisplays:items/advicon_pigeon"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "webdisplays:items/advicon_wd"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "webdisplays:items/badextcard"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "webdisplays:items/extcard"
|
||||
}
|
||||
}
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
},
|
||||
"result": {
|
||||
"item": "webdisplays:craftcomp",
|
||||
"data": 6
|
||||
"data": 6,
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"CCC",
|
||||
"CSC",
|
||||
"CCC"
|
||||
],
|
||||
"key": {
|
||||
"C": {
|
||||
"item": "minecraft:dye",
|
||||
"data": 6
|
||||
},
|
||||
"S": {
|
||||
"item": "webdisplays:screen"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "webdisplays:peripheral",
|
||||
"data": 1
|
||||
}
|
||||
}
|
||||
31
src/main/resources/assets/webdisplays/recipes/extcard.json
Normal file
31
src/main/resources/assets/webdisplays/recipes/extcard.json
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"CTR",
|
||||
"IGD"
|
||||
],
|
||||
"key": {
|
||||
"C": {
|
||||
"item": "minecraft:comparator"
|
||||
},
|
||||
"T": {
|
||||
"item": "minecraft:redstone_torch"
|
||||
},
|
||||
"R": {
|
||||
"item": "minecraft:repeater"
|
||||
},
|
||||
"I": {
|
||||
"item": "minecraft:iron_ingot"
|
||||
},
|
||||
"G": {
|
||||
"item": "minecraft:gold_ingot"
|
||||
},
|
||||
"D": {
|
||||
"item": "minecraft:redstone"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "webdisplays:craftcomp",
|
||||
"data": 7
|
||||
}
|
||||
}
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"KKK",
|
||||
"KRK",
|
||||
"KPK",
|
||||
"KKK"
|
||||
],
|
||||
"key": {
|
||||
|
|
@ -10,12 +10,14 @@
|
|||
"item": "webdisplays:craftcomp",
|
||||
"data": 0
|
||||
},
|
||||
"R": {
|
||||
"item": "minecraft:redstone"
|
||||
"P": {
|
||||
"item": "webdisplays:craftcomp",
|
||||
"data": 2
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "webdisplays:peripheral",
|
||||
"data": 0
|
||||
"data": 0,
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "webdisplays:linker"
|
||||
"item": "webdisplays:linker",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
},
|
||||
"result": {
|
||||
"item": "webdisplays:minepad",
|
||||
"data": 0
|
||||
"data": 0,
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
},
|
||||
"result": {
|
||||
"item": "webdisplays:minepad",
|
||||
"data": 1
|
||||
"data": 1,
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"SSS",
|
||||
"STS",
|
||||
"SSS"
|
||||
],
|
||||
"key": {
|
||||
"S": {
|
||||
"item": "minecraft:wooden_slab",
|
||||
"data": 0
|
||||
},
|
||||
"T": {
|
||||
"item": "minecraft:redstone_torch"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "webdisplays:craftcomp",
|
||||
"data": 2,
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +1,13 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
" E ",
|
||||
" P ",
|
||||
"BBB"
|
||||
],
|
||||
"key": {
|
||||
"E": {
|
||||
"item": "minecraft:ender_pearl"
|
||||
"P": {
|
||||
"item": "webdisplays:craftcomp",
|
||||
"data": 2
|
||||
},
|
||||
"B": {
|
||||
"item": "minecraft:wooden_button"
|
||||
|
|
|
|||
|
|
@ -2,15 +2,16 @@
|
|||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"RRR",
|
||||
"RER",
|
||||
"RPR",
|
||||
"BBB"
|
||||
],
|
||||
"key": {
|
||||
"R": {
|
||||
"item": "minecraft:redstone"
|
||||
},
|
||||
"E": {
|
||||
"item": "minecraft:ender_pearl"
|
||||
"P": {
|
||||
"item": "webdisplays:craftcomp",
|
||||
"data": 2
|
||||
},
|
||||
"B": {
|
||||
"item": "minecraft:wooden_button"
|
||||
|
|
|
|||
|
|
@ -1,16 +1,17 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"QIQ",
|
||||
"I I",
|
||||
"QIQ"
|
||||
" Q ",
|
||||
"QEQ",
|
||||
" Q "
|
||||
],
|
||||
"key": {
|
||||
"Q": {
|
||||
"item": "minecraft:quartz"
|
||||
},
|
||||
"I": {
|
||||
"item": "minecraft:iron_nugget"
|
||||
"E": {
|
||||
"item": "webdisplays:craftcomp",
|
||||
"data": 7
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 373 B |
|
Before Width: | Height: | Size: 322 B After Width: | Height: | Size: 322 B |
Binary file not shown.
|
After Width: | Height: | Size: 299 B |
Binary file not shown.
|
After Width: | Height: | Size: 382 B |
BIN
src/main/resources/assets/webdisplays/textures/items/extcard.png
Normal file
BIN
src/main/resources/assets/webdisplays/textures/items/extcard.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 276 B |
Loading…
Reference in New Issue
Block a user