mirror of
https://github.com/GTNewHorizons/JustEnoughCalculation.git
synced 2026-11-19 03:39:05 +00:00
Add recipe and Chinese.
This commit is contained in:
1 parent
54448c77b8
commit
d79bae7834
17 files changed
+70
-22
No files matched your search
@@ -1,8 +1,13 @@
|
||||
package pers.towdium.justEnoughCalculation;
|
||||
|
||||
import net.minecraft.block.BlockStone;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.SidedProxy;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
@@ -24,7 +29,8 @@ import pers.towdium.justEnoughCalculation.network.packets.PacketSyncRecord;
|
||||
* @author Towdium
|
||||
*/
|
||||
|
||||
@Mod(modid = JustEnoughCalculation.Reference.MODID, name = JustEnoughCalculation.Reference.MODNAME, version = JustEnoughCalculation.Reference.VERSION)
|
||||
@Mod(modid = JustEnoughCalculation.Reference.MODID, name = JustEnoughCalculation.Reference.MODNAME, version = JustEnoughCalculation.Reference.VERSION,
|
||||
dependencies = "required-after:JEI@[1.8.9-2.28.2.166,)")
|
||||
public class JustEnoughCalculation {
|
||||
public static Item itemCalculator = new ItemCalculator().setUnlocalizedName("itemCalculator");
|
||||
public static SimpleNetworkWrapper networkWrapper;
|
||||
@@ -38,8 +44,8 @@ public class JustEnoughCalculation {
|
||||
|
||||
public static class Reference {
|
||||
public static final String MODID = "je_calculation";
|
||||
public static final String MODNAME = "JustEnoughCalculation";
|
||||
public static final String VERSION = "0.0.1";
|
||||
public static final String MODNAME = "Just Enough Calculation";
|
||||
public static final String VERSION = "0.1.1";
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
@@ -59,6 +65,7 @@ public class JustEnoughCalculation {
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().
|
||||
register(itemCalculator, 0, new ModelResourceLocation(Reference.MODID + ":" + itemCalculator.getUnlocalizedName().substring(5), "inventory"));
|
||||
}
|
||||
GameRegistry.addRecipe(new ItemStack(itemCalculator), "SIS", "SRS", "SRS", 'S', new ItemStack(Blocks.stone, 1, 0), 'I', new ItemStack(Items.dye, 1, EnumDyeColor.BLACK.getDyeDamage()), 'R', Items.redstone);
|
||||
proxy.init();
|
||||
}
|
||||
}
|
||||
@@ -60,11 +60,14 @@ public class GuiEventHandler {
|
||||
if (((GuiCalculator) event.gui).getActiveSlot() == 0){
|
||||
Slot slot = ((GuiCalculator) event.gui).inventorySlots.getSlot(0);
|
||||
ItemStack itemStack = JEIPlugin.runtime.getItemListOverlay().getStackUnderMouse();
|
||||
if(itemStack != null){
|
||||
itemStack = itemStack.copy();
|
||||
}
|
||||
if(itemStack != null){
|
||||
ItemStackWrapper.NBT.initNBT(itemStack);
|
||||
itemStack.getTagCompound().setBoolean("mark", true);
|
||||
}
|
||||
slot.putStack(itemStack == null ? null : itemStack.copy());
|
||||
slot.putStack(itemStack == null ? null : itemStack);
|
||||
if (Mouse.isButtonDown(0)){
|
||||
time = new Date().getTime();
|
||||
Slot slot1 = ((GuiCalculator) event.gui).getSlotUnderMouse();
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
package pers.towdium.justEnoughCalculation.gui.commom;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
* CODE IS DONE BY Zyin055
|
||||
@@ -46,6 +50,21 @@ public abstract class GuiTooltipScreen extends GuiContainer
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
DrawTooltipScreen(mouseX, mouseY);
|
||||
InventoryPlayer inventoryplayer = this.mc.thePlayer.inventory;
|
||||
Field field;
|
||||
Slot theSlot = null;
|
||||
try {
|
||||
field = GuiContainer.class.getDeclaredField("theSlot");
|
||||
field.setAccessible(true);
|
||||
theSlot = (Slot) field.get(this);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (inventoryplayer.getItemStack() == null && theSlot != null && theSlot.getHasStack())
|
||||
{
|
||||
ItemStack itemstack1 = theSlot.getStack();
|
||||
this.renderToolTip(itemstack1, mouseX, mouseY);
|
||||
}
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.client.resources.model.ModelManager;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import pers.towdium.justEnoughCalculation.JustEnoughCalculation;
|
||||
import pers.towdium.justEnoughCalculation.core.ItemStackWrapper;
|
||||
import pers.towdium.justEnoughCalculation.core.Recipe;
|
||||
@@ -188,7 +189,7 @@ public class GuiRecipe extends GuiTooltipScreen{
|
||||
@Override
|
||||
protected String GetButtonTooltip(int buttonId) {
|
||||
if(buttonId == 0){
|
||||
return "Switch between_pN: normal mode_pP: percentage mode";
|
||||
return StatCollector.translateToLocal("gui.calculator.tooltipUse");
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package pers.towdium.justEnoughCalculation.item;
|
||||
|
||||
import net.minecraft.client.entity.EntityPlayerSP;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -23,10 +24,4 @@ public class ItemCalculator extends Item {
|
||||
playerIn.openGui(JustEnoughCalculation.instance, GuiHandler.GuiId.CALCULATOR, worldIn, 0, 0, 0);
|
||||
return itemStackIn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
|
||||
//super.addInformation(stack, playerIn, tooltip, advanced);
|
||||
tooltip.add("sdji");
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ import java.util.UUID;
|
||||
* @author Towdium
|
||||
*/
|
||||
public class PlayerHandlerClient implements IPlayerHandler {
|
||||
public List<Recipe> recipes;
|
||||
public List<Recipe> recipes = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void addRecipe(Recipe recipe, UUID uuid) {
|
||||
|
||||
Reference in new issue
Block a user