generated from tilera/1710mod
chore: format code
This commit is contained in:
parent
6992b986ab
commit
994a09a2f2
5 changed files with 535 additions and 193 deletions
|
@ -52,7 +52,9 @@ public class ClassicCasting {
|
||||||
|
|
||||||
proxy.init();
|
proxy.init();
|
||||||
|
|
||||||
ResearchTableExtensionRegistry.registerResearchTableExtension(ClassicResearchTableExtension.class, true);
|
ResearchTableExtensionRegistry.registerResearchTableExtension(
|
||||||
|
ClassicResearchTableExtension.class, true
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Mod.EventHandler
|
@Mod.EventHandler
|
||||||
|
|
|
@ -57,29 +57,65 @@ public class ItemResearchNotes extends Item {
|
||||||
@SideOnly(value = Side.CLIENT)
|
@SideOnly(value = Side.CLIENT)
|
||||||
@Override
|
@Override
|
||||||
public IIcon getIconFromDamageForRenderPass(int par1, int renderPass) {
|
public IIcon getIconFromDamageForRenderPass(int par1, int renderPass) {
|
||||||
return renderPass == 0 ? (par1 / 64 == 0 ? this.iconNote : this.iconDiscovery) : (par1 / 64 == 0 ? this.iconNoteOver : this.iconDiscoveryOver);
|
return renderPass == 0
|
||||||
|
? (par1 / 64 == 0 ? this.iconNote : this.iconDiscovery)
|
||||||
|
: (par1 / 64 == 0 ? this.iconNoteOver : this.iconDiscoveryOver);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack stack, World par2World, EntityPlayer player) {
|
public ItemStack
|
||||||
if (!par2World.isRemote && CCResearchManager.getData(stack).getTotalProgress() == 1.0f && !ResearchManager.isResearchComplete(player.getDisplayName(), CCResearchManager.getData((ItemStack)stack).key)) {
|
onItemRightClick(ItemStack stack, World par2World, EntityPlayer player) {
|
||||||
if (ResearchManager.doesPlayerHaveRequisites(player.getDisplayName(), CCResearchManager.getData((ItemStack)stack).key)) {
|
if (!par2World.isRemote
|
||||||
PacketHandler.INSTANCE.sendTo(new PacketResearchComplete(ResearchManager.getData((ItemStack)stack).key), (EntityPlayerMP)player);
|
&& CCResearchManager.getData(stack).getTotalProgress() == 1.0f
|
||||||
Thaumcraft.proxy.getResearchManager().completeResearch(player, CCResearchManager.getData(stack).key);
|
&& !ResearchManager.isResearchComplete(
|
||||||
String[] siblings = ResearchCategories.getResearch((String)ResearchManager.getData((ItemStack)stack).key).siblings;
|
player.getDisplayName(), CCResearchManager.getData((ItemStack) stack).key
|
||||||
|
)) {
|
||||||
|
if (ResearchManager.doesPlayerHaveRequisites(
|
||||||
|
player.getDisplayName(),
|
||||||
|
CCResearchManager.getData((ItemStack) stack).key
|
||||||
|
)) {
|
||||||
|
PacketHandler.INSTANCE.sendTo(
|
||||||
|
new PacketResearchComplete(
|
||||||
|
ResearchManager.getData((ItemStack) stack).key
|
||||||
|
),
|
||||||
|
(EntityPlayerMP) player
|
||||||
|
);
|
||||||
|
Thaumcraft.proxy.getResearchManager().completeResearch(
|
||||||
|
player, CCResearchManager.getData(stack).key
|
||||||
|
);
|
||||||
|
String[] siblings
|
||||||
|
= ResearchCategories
|
||||||
|
.getResearch(
|
||||||
|
(String) ResearchManager.getData((ItemStack) stack).key
|
||||||
|
)
|
||||||
|
.siblings;
|
||||||
if (siblings != null) {
|
if (siblings != null) {
|
||||||
for (String s : siblings) {
|
for (String s : siblings) {
|
||||||
ResearchItem sibling = ResearchCategories.getResearch(s);
|
ResearchItem sibling = ResearchCategories.getResearch(s);
|
||||||
if (s == null) continue;
|
if (s == null)
|
||||||
if (ResearchManager.isResearchComplete(player.getDisplayName(), sibling.key) || !ResearchManager.doesPlayerHaveRequisites(player.getDisplayName(), sibling.key)) continue;
|
continue;
|
||||||
PacketHandler.INSTANCE.sendTo(new PacketResearchComplete(sibling.key), (EntityPlayerMP)player);
|
if (ResearchManager.isResearchComplete(
|
||||||
Thaumcraft.proxy.getResearchManager().completeResearch(player, sibling.key);
|
player.getDisplayName(), sibling.key
|
||||||
|
)
|
||||||
|
|| !ResearchManager.doesPlayerHaveRequisites(
|
||||||
|
player.getDisplayName(), sibling.key
|
||||||
|
))
|
||||||
|
continue;
|
||||||
|
PacketHandler.INSTANCE.sendTo(
|
||||||
|
new PacketResearchComplete(sibling.key),
|
||||||
|
(EntityPlayerMP) player
|
||||||
|
);
|
||||||
|
Thaumcraft.proxy.getResearchManager().completeResearch(
|
||||||
|
player, sibling.key
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
--stack.stackSize;
|
--stack.stackSize;
|
||||||
par2World.playSoundAtEntity(player, "thaumcraft.learn", 0.75f, 1.0f);
|
par2World.playSoundAtEntity(player, "thaumcraft.learn", 0.75f, 1.0f);
|
||||||
} else {
|
} else {
|
||||||
player.addChatMessage(new ChatComponentText(LanguageRegistry.instance().getStringLocalization("tc.discoveryerror")));
|
player.addChatMessage(new ChatComponentText(
|
||||||
|
LanguageRegistry.instance().getStringLocalization("tc.discoveryerror")
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return stack;
|
return stack;
|
||||||
|
@ -93,7 +129,8 @@ public class ItemResearchNotes extends Item {
|
||||||
md -= 64;
|
md -= 64;
|
||||||
}
|
}
|
||||||
//TODO: WTF
|
//TODO: WTF
|
||||||
//return stack.getItemDamage() == 0 || par2 == 0 ? 0xFFFFFF : EnumTag.get((int)md).color;
|
//return stack.getItemDamage() == 0 || par2 == 0 ? 0xFFFFFF :
|
||||||
|
//EnumTag.get((int)md).color;
|
||||||
return 0xFFFFFF;
|
return 0xFFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,20 +147,33 @@ public class ItemResearchNotes extends Item {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getItemStackDisplayName(ItemStack itemstack) {
|
public String getItemStackDisplayName(ItemStack itemstack) {
|
||||||
return itemstack.getItemDamage() < 64 ? LanguageRegistry.instance().getStringLocalization("item.researchnotes.name") : LanguageRegistry.instance().getStringLocalization("item.discovery.name");
|
return itemstack.getItemDamage() < 64
|
||||||
|
? LanguageRegistry.instance().getStringLocalization("item.researchnotes.name")
|
||||||
|
: LanguageRegistry.instance().getStringLocalization("item.discovery.name");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
public void addInformation(
|
||||||
|
ItemStack stack, EntityPlayer par2EntityPlayer, List list, boolean par4
|
||||||
|
) {
|
||||||
if (CCResearchManager.getData(stack).getTotalProgress() >= 0.2f) {
|
if (CCResearchManager.getData(stack).getTotalProgress() >= 0.2f) {
|
||||||
ResearchItem item = ResearchCategories.getResearch(ResearchManager.getData((ItemStack)stack).key);
|
ResearchItem item = ResearchCategories.getResearch(
|
||||||
|
ResearchManager.getData((ItemStack) stack).key
|
||||||
|
);
|
||||||
if (item != null)
|
if (item != null)
|
||||||
list.add(item.getName());
|
list.add(item.getName());
|
||||||
} else {
|
} else {
|
||||||
list.add(LanguageRegistry.instance().getStringLocalization("tc.discoveryunknown"));
|
list.add(
|
||||||
|
LanguageRegistry.instance().getStringLocalization("tc.discoveryunknown")
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (stack.getItemDamage() < 64 && CCResearchManager.getData(stack).getTotalProgress() > 0.333332f) {
|
if (stack.getItemDamage() < 64
|
||||||
list.add((int)(CCResearchManager.getData(stack).getTotalProgress() * 100.0f) + LanguageRegistry.instance().getStringLocalization("tc.discoveryprogress"));
|
&& CCResearchManager.getData(stack).getTotalProgress() > 0.333332f) {
|
||||||
|
list.add(
|
||||||
|
(int) (CCResearchManager.getData(stack).getTotalProgress() * 100.0f)
|
||||||
|
+ LanguageRegistry.instance().getStringLocalization("tc.discoveryprogress"
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,4 +181,3 @@ public class ItemResearchNotes extends Item {
|
||||||
return itemstack.getItemDamage() < 64 ? EnumRarity.rare : EnumRarity.epic;
|
return itemstack.getItemDamage() < 64 ? EnumRarity.rare : EnumRarity.epic;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,10 @@ import thaumcraft.common.config.ConfigItems;
|
||||||
import thaumcraft.common.lib.research.ResearchManager;
|
import thaumcraft.common.lib.research.ResearchManager;
|
||||||
|
|
||||||
public class CCResearchManager {
|
public class CCResearchManager {
|
||||||
|
|
||||||
public static ItemStack createNote(ItemStack stack, String key) {
|
public static ItemStack createNote(ItemStack stack, String key) {
|
||||||
ResearchItem research = ResearchCategories.getResearch(key);
|
ResearchItem research = ResearchCategories.getResearch(key);
|
||||||
if (research == null) return null;
|
if (research == null)
|
||||||
|
return null;
|
||||||
if (stack.stackTagCompound == null) {
|
if (stack.stackTagCompound == null) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
stack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,8 @@ public class CCResearchManager {
|
||||||
return var1;
|
return var1;
|
||||||
}
|
}
|
||||||
NBTTagCompound var3 = stack.stackTagCompound.getCompoundTag("tcr");
|
NBTTagCompound var3 = stack.stackTagCompound.getCompoundTag("tcr");
|
||||||
if (!var3.hasKey("project") || !var3.hasKey("tags") || !var3.hasKey("progress") || !var3.hasKey("failed")) {
|
if (!var3.hasKey("project") || !var3.hasKey("tags") || !var3.hasKey("progress")
|
||||||
|
|| !var3.hasKey("failed")) {
|
||||||
return var1;
|
return var1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,8 +68,8 @@ public class CCResearchManager {
|
||||||
busted = true;
|
busted = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!busted && var1.tags.length != ResearchList.getResearchTags(var1.key).length) {
|
if (!busted && var1.tags.length != ResearchList.getResearchTags(var1.key).length)
|
||||||
busted = true;
|
{ busted = true;
|
||||||
}
|
}
|
||||||
if (busted) {
|
if (busted) {
|
||||||
byte[] tt = var1.tags;
|
byte[] tt = var1.tags;
|
||||||
|
@ -87,7 +88,6 @@ public class CCResearchManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void updateData(ItemStack stack, ResearchNoteData data) {
|
public static void updateData(ItemStack stack, ResearchNoteData data) {
|
||||||
|
|
||||||
if (stack.stackTagCompound == null) {
|
if (stack.stackTagCompound == null) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
stack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
|
@ -111,29 +111,47 @@ public class CCResearchManager {
|
||||||
data.failedTags.writeToNBT(var3, "failed");
|
data.failedTags.writeToNBT(var3, "failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void createResearchNoteForTable(ClassicResearchTableExtension table, String key) {
|
public static void
|
||||||
if (table.getStackInSlot(5) == null && table.getStackInSlot(6) != null && table.getStackInSlot(6).isItemEqual(new ItemStack(Items.paper))) {
|
createResearchNoteForTable(ClassicResearchTableExtension table, String key) {
|
||||||
|
if (table.getStackInSlot(5) == null && table.getStackInSlot(6) != null
|
||||||
|
&& table.getStackInSlot(6).isItemEqual(new ItemStack(Items.paper))) {
|
||||||
table.decrStackSize(6, 1);
|
table.decrStackSize(6, 1);
|
||||||
ResearchItem item = ResearchCategories.getResearch(key);
|
ResearchItem item = ResearchCategories.getResearch(key);
|
||||||
//int md = ResearchList.getResearchPrimaryTag(key);
|
//int md = ResearchList.getResearchPrimaryTag(key);
|
||||||
int md = 0;
|
int md = 0;
|
||||||
table.setInventorySlotContents(5, CCResearchManager.createNote(new ItemStack(CCItems.researchNotes, 1, md), key));
|
table.setInventorySlotContents(
|
||||||
|
5,
|
||||||
|
CCResearchManager.createNote(
|
||||||
|
new ItemStack(CCItems.researchNotes, 1, md), key
|
||||||
|
)
|
||||||
|
);
|
||||||
table.markDirty();
|
table.markDirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String findMatchingResearch(EntityPlayer player, Aspect[] tags, short[] tagAmounts) {
|
public static String
|
||||||
|
findMatchingResearch(EntityPlayer player, Aspect[] tags, short[] tagAmounts) {
|
||||||
int bestMatchNum = 0;
|
int bestMatchNum = 0;
|
||||||
String bestMatch = null;
|
String bestMatch = null;
|
||||||
for (ResearchCategoryList cat : ResearchCategories.researchCategories.values()) {
|
for (ResearchCategoryList cat : ResearchCategories.researchCategories.values()) {
|
||||||
for (ResearchItem research : cat.research.values()) {
|
for (ResearchItem research : cat.research.values()) {
|
||||||
if (research.isStub() || research.isLost() || ResearchManager.isResearchComplete(player.getDisplayName(), research.key) || !ResearchManager.doesPlayerHaveRequisites(player.getDisplayName(), research.key)) continue;
|
if (research.isStub() || research.isLost()
|
||||||
|
|| ResearchManager.isResearchComplete(
|
||||||
|
player.getDisplayName(), research.key
|
||||||
|
)
|
||||||
|
|| !ResearchManager.doesPlayerHaveRequisites(
|
||||||
|
player.getDisplayName(), research.key
|
||||||
|
))
|
||||||
|
continue;
|
||||||
int match = 0;
|
int match = 0;
|
||||||
for (int q = 0; q < 5; ++q) {
|
for (int q = 0; q < 5; ++q) {
|
||||||
if (tags[q] == null || tagAmounts[q] <= 0 || research.tags.getAmount(tags[q]) <= 0) continue;
|
if (tags[q] == null || tagAmounts[q] <= 0
|
||||||
|
|| research.tags.getAmount(tags[q]) <= 0)
|
||||||
|
continue;
|
||||||
++match;
|
++match;
|
||||||
}
|
}
|
||||||
if (match <= 0 || match <= bestMatchNum) continue;
|
if (match <= 0 || match <= bestMatchNum)
|
||||||
|
continue;
|
||||||
bestMatchNum = match;
|
bestMatchNum = match;
|
||||||
bestMatch = research.key;
|
bestMatch = research.key;
|
||||||
}
|
}
|
||||||
|
@ -141,41 +159,59 @@ public class CCResearchManager {
|
||||||
return bestMatch;
|
return bestMatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean progressTableResearch(World world, EntityPlayer researcher, ClassicResearchTableExtension table, ItemStack note, int baseChance, int baseLoss, Aspect[] inTags, short[] inTagAmounts) {
|
public static boolean progressTableResearch(
|
||||||
|
World world,
|
||||||
|
EntityPlayer researcher,
|
||||||
|
ClassicResearchTableExtension table,
|
||||||
|
ItemStack note,
|
||||||
|
int baseChance,
|
||||||
|
int baseLoss,
|
||||||
|
Aspect[] inTags,
|
||||||
|
short[] inTagAmounts
|
||||||
|
) {
|
||||||
AspectList tags;
|
AspectList tags;
|
||||||
String key;
|
String key;
|
||||||
boolean progressed = false;
|
boolean progressed = false;
|
||||||
if (baseLoss <= 0) {
|
if (baseLoss <= 0) {
|
||||||
baseLoss = 1;
|
baseLoss = 1;
|
||||||
}
|
}
|
||||||
if (note.stackTagCompound == null && (key = CCResearchManager.findLostResearch(researcher)) != null) {
|
if (note.stackTagCompound == null
|
||||||
|
&& (key = CCResearchManager.findLostResearch(researcher)) != null) {
|
||||||
note = CCResearchManager.createNote(note, key);
|
note = CCResearchManager.createNote(note, key);
|
||||||
}
|
}
|
||||||
ResearchNoteData data = CCResearchManager.getData(note);
|
ResearchNoteData data = CCResearchManager.getData(note);
|
||||||
ResearchItem research = ResearchCategories.getResearch(data.key);
|
ResearchItem research = ResearchCategories.getResearch(data.key);
|
||||||
if (research == null) return false;
|
if (research == null)
|
||||||
|
return false;
|
||||||
if ((tags = research.tags.copy()) != null) {
|
if ((tags = research.tags.copy()) != null) {
|
||||||
boolean found;
|
boolean found;
|
||||||
for (Aspect tag : inTags) {
|
for (Aspect tag : inTags) {
|
||||||
if (tag == null) continue;
|
if (tag == null)
|
||||||
|
continue;
|
||||||
found = false;
|
found = false;
|
||||||
for (Aspect entry : tags.getAspects()) {
|
for (Aspect entry : tags.getAspects()) {
|
||||||
if (entry != tag) continue;
|
if (entry != tag)
|
||||||
|
continue;
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (found || data.failedTags.getAmount(tag) >= 100) continue;
|
if (found || data.failedTags.getAmount(tag) >= 100)
|
||||||
data.failedTags.add(tag, Math.round((float)(2 + world.rand.nextInt(baseLoss)) / 10.0f));
|
continue;
|
||||||
|
data.failedTags.add(
|
||||||
|
tag, Math.round((float) (2 + world.rand.nextInt(baseLoss)) / 10.0f)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
for (Aspect tag : tags.getAspects()) {
|
for (Aspect tag : tags.getAspects()) {
|
||||||
found = false;
|
found = false;
|
||||||
int entry;
|
int entry;
|
||||||
for (entry = 0; entry < inTags.length; ++entry) {
|
for (entry = 0; entry < inTags.length; ++entry) {
|
||||||
if (inTags[entry] != tag) continue;
|
if (inTags[entry] != tag)
|
||||||
|
continue;
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!found) continue;
|
if (!found)
|
||||||
|
continue;
|
||||||
float chance = (float) baseChance / 100.0f;
|
float chance = (float) baseChance / 100.0f;
|
||||||
int tries = CCResearchManager.researchIterations(inTagAmounts[entry]);
|
int tries = CCResearchManager.researchIterations(inTagAmounts[entry]);
|
||||||
if (tries == 0) {
|
if (tries == 0) {
|
||||||
|
@ -183,8 +219,11 @@ public class CCResearchManager {
|
||||||
chance = (float) baseChance / 2.0f;
|
chance = (float) baseChance / 2.0f;
|
||||||
}
|
}
|
||||||
for (int a = 0; a < tries; ++a) {
|
for (int a = 0; a < tries; ++a) {
|
||||||
if (!(world.rand.nextFloat() <= chance)) continue;
|
if (!(world.rand.nextFloat() <= chance))
|
||||||
if (data.tags.getAmount(tag) <= 0 || data.progress.get(tag) >= research.tags.getAmount(tag)) break;
|
continue;
|
||||||
|
if (data.tags.getAmount(tag) <= 0
|
||||||
|
|| data.progress.get(tag) >= research.tags.getAmount(tag))
|
||||||
|
break;
|
||||||
data.progress.put(tag, data.progress.get(tag) + 1);
|
data.progress.put(tag, data.progress.get(tag) + 1);
|
||||||
chance *= 0.9f;
|
chance *= 0.9f;
|
||||||
progressed = true;
|
progressed = true;
|
||||||
|
@ -193,7 +232,8 @@ public class CCResearchManager {
|
||||||
}
|
}
|
||||||
CCResearchManager.updateData(note, data);
|
CCResearchManager.updateData(note, data);
|
||||||
} else {
|
} else {
|
||||||
table.contents[5] = new ItemStack(ConfigItems.itemResource, 7 + world.rand.nextInt(3), 9);
|
table.contents[5]
|
||||||
|
= new ItemStack(ConfigItems.itemResource, 7 + world.rand.nextInt(3), 9);
|
||||||
}
|
}
|
||||||
return progressed;
|
return progressed;
|
||||||
}
|
}
|
||||||
|
@ -207,12 +247,20 @@ public class CCResearchManager {
|
||||||
ArrayList<String> choices = new ArrayList<String>();
|
ArrayList<String> choices = new ArrayList<String>();
|
||||||
for (ResearchCategoryList cat : ResearchCategories.researchCategories.values()) {
|
for (ResearchCategoryList cat : ResearchCategories.researchCategories.values()) {
|
||||||
for (ResearchItem research : cat.research.values()) {
|
for (ResearchItem research : cat.research.values()) {
|
||||||
if (research.isStub() || !research.isLost() || ResearchManager.isResearchComplete(player.getDisplayName(), research.key) || !ResearchManager.doesPlayerHaveRequisites(player.getDisplayName(), research.key)) continue;
|
if (research.isStub() || !research.isLost()
|
||||||
|
|| ResearchManager.isResearchComplete(
|
||||||
|
player.getDisplayName(), research.key
|
||||||
|
)
|
||||||
|
|| !ResearchManager.doesPlayerHaveRequisites(
|
||||||
|
player.getDisplayName(), research.key
|
||||||
|
))
|
||||||
|
continue;
|
||||||
choices.add(research.key);
|
choices.add(research.key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (choices.size() > 0) {
|
if (choices.size() > 0) {
|
||||||
bestMatch = (String)choices.get(player.worldObj.rand.nextInt(choices.size()));
|
bestMatch
|
||||||
|
= (String) choices.get(player.worldObj.rand.nextInt(choices.size()));
|
||||||
}
|
}
|
||||||
return bestMatch;
|
return bestMatch;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,8 +32,8 @@ import thaumcraft.api.aspects.AspectList;
|
||||||
import thaumcraft.common.config.ConfigBlocks;
|
import thaumcraft.common.config.ConfigBlocks;
|
||||||
import thaumcraft.common.lib.crafting.ThaumcraftCraftingManager;
|
import thaumcraft.common.lib.crafting.ThaumcraftCraftingManager;
|
||||||
|
|
||||||
public class ClassicResearchTableExtension extends ResearchTableExtension implements IInventory {
|
public class ClassicResearchTableExtension
|
||||||
|
extends ResearchTableExtension implements IInventory {
|
||||||
public ItemStack[] contents = new ItemStack[7];
|
public ItemStack[] contents = new ItemStack[7];
|
||||||
public EntityPlayer researcher = null;
|
public EntityPlayer researcher = null;
|
||||||
public boolean safe = true;
|
public boolean safe = true;
|
||||||
|
@ -55,7 +55,8 @@ public class ClassicResearchTableExtension extends ResearchTableExtension implem
|
||||||
nbt.setBoolean("Safe", this.safe);
|
nbt.setBoolean("Safe", this.safe);
|
||||||
NBTTagList var2 = new NBTTagList();
|
NBTTagList var2 = new NBTTagList();
|
||||||
for (int var3 = 0; var3 < this.contents.length; ++var3) {
|
for (int var3 = 0; var3 < this.contents.length; ++var3) {
|
||||||
if (this.contents[var3] == null) continue;
|
if (this.contents[var3] == null)
|
||||||
|
continue;
|
||||||
NBTTagCompound var4 = new NBTTagCompound();
|
NBTTagCompound var4 = new NBTTagCompound();
|
||||||
var4.setByte("Slot", (byte) var3);
|
var4.setByte("Slot", (byte) var3);
|
||||||
this.contents[var3].writeToNBT(var4);
|
this.contents[var3].writeToNBT(var4);
|
||||||
|
@ -72,7 +73,8 @@ public class ClassicResearchTableExtension extends ResearchTableExtension implem
|
||||||
for (int var3 = 0; var3 < var2.tagCount(); ++var3) {
|
for (int var3 = 0; var3 < var2.tagCount(); ++var3) {
|
||||||
NBTTagCompound var4 = var2.getCompoundTagAt(var3);
|
NBTTagCompound var4 = var2.getCompoundTagAt(var3);
|
||||||
int var5 = var4.getByte("Slot") & 0xFF;
|
int var5 = var4.getByte("Slot") & 0xFF;
|
||||||
if (var5 < 0 || var5 >= this.contents.length) continue;
|
if (var5 < 0 || var5 >= this.contents.length)
|
||||||
|
continue;
|
||||||
this.contents[var5] = ItemStack.loadItemStackFromNBT((NBTTagCompound) var4);
|
this.contents[var5] = ItemStack.loadItemStackFromNBT((NBTTagCompound) var4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -121,18 +123,41 @@ public class ClassicResearchTableExtension extends ResearchTableExtension implem
|
||||||
amounts[n] = (short) (amounts[n] + Math.round(this.tagBonus[a]));
|
amounts[n] = (short) (amounts[n] + Math.round(this.tagBonus[a]));
|
||||||
}
|
}
|
||||||
if (this.contents[5] == null) {
|
if (this.contents[5] == null) {
|
||||||
String key = CCResearchManager.findMatchingResearch(this.researcher, this.tags, amounts);
|
String key = CCResearchManager.findMatchingResearch(
|
||||||
|
this.researcher, this.tags, amounts
|
||||||
|
);
|
||||||
if (key != null) {
|
if (key != null) {
|
||||||
CCResearchManager.createResearchNoteForTable(this, key);
|
CCResearchManager.createResearchNoteForTable(this, key);
|
||||||
if (this.contents[5] != null) {
|
if (this.contents[5] != null) {
|
||||||
CCResearchManager.progressTableResearch(this.world, this.researcher, this, this.contents[5], this.baseChance, this.baseLoss, this.tags, amounts);
|
CCResearchManager.progressTableResearch(
|
||||||
if (CCResearchManager.getData(this.contents[5]).getTotalProgress() == 1.0f) {
|
this.world,
|
||||||
this.contents[5].setItemDamage(this.contents[5].getItemDamage() + 64);
|
this.researcher,
|
||||||
|
this,
|
||||||
|
this.contents[5],
|
||||||
|
this.baseChance,
|
||||||
|
this.baseLoss,
|
||||||
|
this.tags,
|
||||||
|
amounts
|
||||||
|
);
|
||||||
|
if (CCResearchManager.getData(this.contents[5]).getTotalProgress()
|
||||||
|
== 1.0f) {
|
||||||
|
this.contents[5].setItemDamage(
|
||||||
|
this.contents[5].getItemDamage() + 64
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (this.contents[5].getItem() == CCItems.researchNotes && this.contents[5].getItemDamage() < 64) {
|
} else if (this.contents[5].getItem() == CCItems.researchNotes && this.contents[5].getItemDamage() < 64) {
|
||||||
CCResearchManager.progressTableResearch(this.world, this.researcher, this, this.contents[5], this.baseChance, this.baseLoss, this.tags, amounts);
|
CCResearchManager.progressTableResearch(
|
||||||
|
this.world,
|
||||||
|
this.researcher,
|
||||||
|
this,
|
||||||
|
this.contents[5],
|
||||||
|
this.baseChance,
|
||||||
|
this.baseLoss,
|
||||||
|
this.tags,
|
||||||
|
amounts
|
||||||
|
);
|
||||||
if (CCResearchManager.getData(this.contents[5]).getTotalProgress() == 1.0f) {
|
if (CCResearchManager.getData(this.contents[5]).getTotalProgress() == 1.0f) {
|
||||||
this.contents[5].setItemDamage(this.contents[5].getItemDamage() + 64);
|
this.contents[5].setItemDamage(this.contents[5].getItemDamage() + 64);
|
||||||
}
|
}
|
||||||
|
@ -141,14 +166,23 @@ public class ClassicResearchTableExtension extends ResearchTableExtension implem
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startResearch() {
|
public void startResearch() {
|
||||||
this.world.playSoundEffect((double)this.xCoord, (double)this.yCoord, (double)this.zCoord, "random.click", 0.15f, 0.8f);
|
this.world.playSoundEffect(
|
||||||
|
(double) this.xCoord,
|
||||||
|
(double) this.yCoord,
|
||||||
|
(double) this.zCoord,
|
||||||
|
"random.click",
|
||||||
|
0.15f,
|
||||||
|
0.8f
|
||||||
|
);
|
||||||
if (!this.world.isRemote) {
|
if (!this.world.isRemote) {
|
||||||
this.doResearch();
|
this.doResearch();
|
||||||
int chance = this.baseLoss;
|
int chance = this.baseLoss;
|
||||||
for (int a = 0; a < 5; ++a) {
|
for (int a = 0; a < 5; ++a) {
|
||||||
if (this.contents[a] == null || this.world.rand.nextInt(100) >= chance) continue;
|
if (this.contents[a] == null || this.world.rand.nextInt(100) >= chance)
|
||||||
|
continue;
|
||||||
--this.contents[a].stackSize;
|
--this.contents[a].stackSize;
|
||||||
if (this.contents[a].stackSize != 0) continue;
|
if (this.contents[a].stackSize != 0)
|
||||||
|
continue;
|
||||||
this.contents[a] = null;
|
this.contents[a] = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -159,12 +193,20 @@ public class ClassicResearchTableExtension extends ResearchTableExtension implem
|
||||||
public void toggleSafe() {
|
public void toggleSafe() {
|
||||||
this.safe = !this.safe;
|
this.safe = !this.safe;
|
||||||
this.recalcBaseChance();
|
this.recalcBaseChance();
|
||||||
this.world.playSoundEffect((double)this.xCoord, (double)this.yCoord, (double)this.zCoord, "step.wood", 0.3f, 1.2f);
|
this.world.playSoundEffect(
|
||||||
|
(double) this.xCoord,
|
||||||
|
(double) this.yCoord,
|
||||||
|
(double) this.zCoord,
|
||||||
|
"step.wood",
|
||||||
|
0.3f,
|
||||||
|
1.2f
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void gatherResults() {
|
public void gatherResults() {
|
||||||
this.data = null;
|
this.data = null;
|
||||||
if (this.contents[5] != null && this.contents[5].getItem() instanceof ItemResearchNotes) {
|
if (this.contents[5] != null
|
||||||
|
&& this.contents[5].getItem() instanceof ItemResearchNotes) {
|
||||||
this.data = CCResearchManager.getData(this.contents[5]);
|
this.data = CCResearchManager.getData(this.contents[5]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -184,9 +226,12 @@ public class ClassicResearchTableExtension extends ResearchTableExtension implem
|
||||||
this.tags[a] = null;
|
this.tags[a] = null;
|
||||||
this.tagAmounts[a] = 0;
|
this.tagAmounts[a] = 0;
|
||||||
this.tagBonus[a] = 0.0f;
|
this.tagBonus[a] = 0.0f;
|
||||||
if (this.contents[a] == null) continue;
|
if (this.contents[a] == null)
|
||||||
|
continue;
|
||||||
AspectList t = ThaumcraftCraftingManager.getObjectTags(this.contents[a]);
|
AspectList t = ThaumcraftCraftingManager.getObjectTags(this.contents[a]);
|
||||||
if ((t = ThaumcraftCraftingManager.getBonusTags(this.contents[a], t)) == null || t.size() <= 0) continue;
|
if ((t = ThaumcraftCraftingManager.getBonusTags(this.contents[a], t)) == null
|
||||||
|
|| t.size() <= 0)
|
||||||
|
continue;
|
||||||
for (Aspect tag : t.getAspects()) {
|
for (Aspect tag : t.getAspects()) {
|
||||||
ot.merge(tag, t.getAmount(tag));
|
ot.merge(tag, t.getAmount(tag));
|
||||||
}
|
}
|
||||||
|
@ -195,7 +240,8 @@ public class ClassicResearchTableExtension extends ResearchTableExtension implem
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ArrayList<Aspect> sortedTags = new ArrayList<Aspect>();
|
ArrayList<Aspect> sortedTags = new ArrayList<Aspect>();
|
||||||
block2: for (Aspect tag : ot.getAspects()) {
|
block2:
|
||||||
|
for (Aspect tag : ot.getAspects()) {
|
||||||
if (sortedTags.size() == 0) {
|
if (sortedTags.size() == 0) {
|
||||||
sortedTags.add(tag);
|
sortedTags.add(tag);
|
||||||
continue;
|
continue;
|
||||||
|
@ -205,7 +251,9 @@ public class ClassicResearchTableExtension extends ResearchTableExtension implem
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (int a = 1; a < sortedTags.size(); ++a) {
|
for (int a = 1; a < sortedTags.size(); ++a) {
|
||||||
if (ot.getAmount(tag) <= ot.getAmount((Aspect)((Object)sortedTags.get(a)))) continue;
|
if (ot.getAmount(tag)
|
||||||
|
<= ot.getAmount((Aspect) ((Object) sortedTags.get(a))))
|
||||||
|
continue;
|
||||||
sortedTags.add(a, tag);
|
sortedTags.add(a, tag);
|
||||||
continue block2;
|
continue block2;
|
||||||
}
|
}
|
||||||
|
@ -215,7 +263,8 @@ public class ClassicResearchTableExtension extends ResearchTableExtension implem
|
||||||
for (int a = 0; a < 5; ++a) {
|
for (int a = 0; a < 5; ++a) {
|
||||||
if (sortedTags.size() > a && sortedTags.get(a) != null) {
|
if (sortedTags.size() > a && sortedTags.get(a) != null) {
|
||||||
this.tags[a] = sortedTags.get(a);
|
this.tags[a] = sortedTags.get(a);
|
||||||
this.tagAmounts[a] = (short)ot.getAmount((Aspect)((Object)sortedTags.get(a)));
|
this.tagAmounts[a]
|
||||||
|
= (short) ot.getAmount((Aspect) ((Object) sortedTags.get(a)));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
this.tags[a] = null;
|
this.tags[a] = null;
|
||||||
|
@ -227,10 +276,16 @@ public class ClassicResearchTableExtension extends ResearchTableExtension implem
|
||||||
|
|
||||||
private void recalculateBonus() {
|
private void recalculateBonus() {
|
||||||
List<EntityLivingBase> ents;
|
List<EntityLivingBase> ents;
|
||||||
if (!this.world.isDaytime() && this.world.getBlockLightValue(this.xCoord, this.yCoord + 1, this.zCoord) < 4 && !this.world.canBlockSeeTheSky(this.xCoord, this.yCoord + 1, this.zCoord)) {
|
if (!this.world.isDaytime()
|
||||||
|
&& this.world.getBlockLightValue(this.xCoord, this.yCoord + 1, this.zCoord)
|
||||||
|
< 4
|
||||||
|
&& !this.world.canBlockSeeTheSky(this.xCoord, this.yCoord + 1, this.zCoord)) {
|
||||||
this.incrementTagBonus(1.0f, Arrays.asList(new Aspect[] { Aspect.DARKNESS }));
|
this.incrementTagBonus(1.0f, Arrays.asList(new Aspect[] { Aspect.DARKNESS }));
|
||||||
}
|
}
|
||||||
if (this.world.isDaytime() && this.world.getBlockLightValue(this.xCoord, this.yCoord + 1, this.zCoord) > 11 && this.world.canBlockSeeTheSky(this.xCoord, this.yCoord + 1, this.zCoord)) {
|
if (this.world.isDaytime()
|
||||||
|
&& this.world.getBlockLightValue(this.xCoord, this.yCoord + 1, this.zCoord)
|
||||||
|
> 11
|
||||||
|
&& this.world.canBlockSeeTheSky(this.xCoord, this.yCoord + 1, this.zCoord)) {
|
||||||
this.incrementTagBonus(1.0f, Arrays.asList(new Aspect[] { Aspect.LIGHT }));
|
this.incrementTagBonus(1.0f, Arrays.asList(new Aspect[] { Aspect.LIGHT }));
|
||||||
}
|
}
|
||||||
if ((float) this.yCoord > (float) this.world.getActualHeight() * 0.5f) {
|
if ((float) this.yCoord > (float) this.world.getActualHeight() * 0.5f) {
|
||||||
|
@ -246,62 +301,120 @@ public class ClassicResearchTableExtension extends ResearchTableExtension implem
|
||||||
this.incrementTagBonus(1.0f, Arrays.asList(new Aspect[] { Aspect.WEATHER }));
|
this.incrementTagBonus(1.0f, Arrays.asList(new Aspect[] { Aspect.WEATHER }));
|
||||||
}
|
}
|
||||||
if (this.world.isThundering()) {
|
if (this.world.isThundering()) {
|
||||||
this.incrementTagBonus(1.0f, Arrays.asList(new Aspect[]{Aspect.WEATHER, Aspect.ENERGY, Aspect.AIR}));
|
this.incrementTagBonus(
|
||||||
|
1.0f,
|
||||||
|
Arrays.asList(new Aspect[] { Aspect.WEATHER, Aspect.ENERGY, Aspect.AIR })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if ((ents = this.world.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox((double)this.xCoord, (double)this.yCoord, (double)this.zCoord, (double)(this.xCoord + 1), (double)(this.yCoord + 1), (double)(this.zCoord + 1)).expand(15.0, 15.0, 15.0))).size() > 0) {
|
if ((ents = this.world.getEntitiesWithinAABB(
|
||||||
|
EntityLivingBase.class,
|
||||||
|
AxisAlignedBB
|
||||||
|
.getBoundingBox(
|
||||||
|
(double) this.xCoord,
|
||||||
|
(double) this.yCoord,
|
||||||
|
(double) this.zCoord,
|
||||||
|
(double) (this.xCoord + 1),
|
||||||
|
(double) (this.yCoord + 1),
|
||||||
|
(double) (this.zCoord + 1)
|
||||||
|
)
|
||||||
|
.expand(15.0, 15.0, 15.0)
|
||||||
|
))
|
||||||
|
.size()
|
||||||
|
> 0) {
|
||||||
for (Object ent : ents) {
|
for (Object ent : ents) {
|
||||||
try {
|
try {
|
||||||
if (((EntityLivingBase) ent).isAirBorne) {
|
if (((EntityLivingBase) ent).isAirBorne) {
|
||||||
this.incrementTagBonus(0.5f, Arrays.asList(new Aspect[]{Aspect.FLIGHT}));
|
this.incrementTagBonus(
|
||||||
|
0.5f, Arrays.asList(new Aspect[] { Aspect.FLIGHT })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (((EntityLivingBase)ent).getMaxHealth() - ((EntityLivingBase)ent).getHealth() > 0) {
|
if (((EntityLivingBase) ent).getMaxHealth()
|
||||||
this.incrementTagBonus(0.5f, Arrays.asList(new Aspect[]{Aspect.FLESH}));
|
- ((EntityLivingBase) ent).getHealth()
|
||||||
|
> 0) {
|
||||||
|
this.incrementTagBonus(
|
||||||
|
0.5f, Arrays.asList(new Aspect[] { Aspect.FLESH })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (((EntityLivingBase) ent).isEntityUndead()) {
|
if (((EntityLivingBase) ent).isEntityUndead()) {
|
||||||
this.incrementTagBonus(0.3f, Arrays.asList(new Aspect[]{Aspect.DEATH, Aspects.EVIL}));
|
this.incrementTagBonus(
|
||||||
this.incrementTagBonus(0.2f, Arrays.asList(new Aspect[]{Aspect.SOUL}));
|
0.3f,
|
||||||
|
Arrays.asList(new Aspect[] { Aspect.DEATH, Aspects.EVIL })
|
||||||
|
);
|
||||||
|
this.incrementTagBonus(
|
||||||
|
0.2f, Arrays.asList(new Aspect[] { Aspect.SOUL })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (((EntityLivingBase) ent).isPotionActive(Potion.poison)) {
|
if (((EntityLivingBase) ent).isPotionActive(Potion.poison)) {
|
||||||
this.incrementTagBonus(0.5f, Arrays.asList(new Aspect[]{Aspect.POISON}));
|
this.incrementTagBonus(
|
||||||
|
0.5f, Arrays.asList(new Aspect[] { Aspect.POISON })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (((EntityLivingBase) ent).isPotionActive(Potion.regeneration)) {
|
if (((EntityLivingBase) ent).isPotionActive(Potion.regeneration)) {
|
||||||
this.incrementTagBonus(0.5f, Arrays.asList(new Aspect[]{Aspect.HEAL}));
|
this.incrementTagBonus(
|
||||||
|
0.5f, Arrays.asList(new Aspect[] { Aspect.HEAL })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (((EntityLivingBase) ent).isPotionActive(Potion.resistance)) {
|
if (((EntityLivingBase) ent).isPotionActive(Potion.resistance)) {
|
||||||
this.incrementTagBonus(0.5f, Arrays.asList(new Aspect[]{Aspect.ARMOR}));
|
this.incrementTagBonus(
|
||||||
|
0.5f, Arrays.asList(new Aspect[] { Aspect.ARMOR })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (((EntityLivingBase) ent).isPotionActive(Potion.nightVision)) {
|
if (((EntityLivingBase) ent).isPotionActive(Potion.nightVision)) {
|
||||||
this.incrementTagBonus(0.5f, Arrays.asList(new Aspect[]{Aspects.VISION}));
|
this.incrementTagBonus(
|
||||||
|
0.5f, Arrays.asList(new Aspect[] { Aspects.VISION })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (((EntityLivingBase) ent).isPotionActive(Potion.confusion)) {
|
if (((EntityLivingBase) ent).isPotionActive(Potion.confusion)) {
|
||||||
this.incrementTagBonus(0.5f, Arrays.asList(new Aspect[]{Aspects.FLUX}));
|
this.incrementTagBonus(
|
||||||
|
0.5f, Arrays.asList(new Aspect[] { Aspects.FLUX })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (ent instanceof EntitySpider) {
|
if (ent instanceof EntitySpider) {
|
||||||
this.incrementTagBonus(0.3f, Arrays.asList(new Aspect[]{Aspects.INSECT}));
|
this.incrementTagBonus(
|
||||||
|
0.3f, Arrays.asList(new Aspect[] { Aspects.INSECT })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (ent instanceof EntityAnimal) {
|
if (ent instanceof EntityAnimal) {
|
||||||
this.incrementTagBonus(0.2f, Arrays.asList(new Aspect[]{Aspect.BEAST}));
|
this.incrementTagBonus(
|
||||||
|
0.2f, Arrays.asList(new Aspect[] { Aspect.BEAST })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (ent instanceof EntitySheep) {
|
if (ent instanceof EntitySheep) {
|
||||||
this.incrementTagBonus(0.2f, Arrays.asList(new Aspect[]{Aspect.CLOTH}));
|
this.incrementTagBonus(
|
||||||
|
0.2f, Arrays.asList(new Aspect[] { Aspect.CLOTH })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (ent instanceof EntityPlayer) {
|
if (ent instanceof EntityPlayer) {
|
||||||
this.incrementTagBonus(0.4f, Arrays.asList(new Aspect[]{Aspects.CONTROL}));
|
this.incrementTagBonus(
|
||||||
|
0.4f, Arrays.asList(new Aspect[] { Aspects.CONTROL })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (ent instanceof EntityVillager) {
|
if (ent instanceof EntityVillager) {
|
||||||
this.incrementTagBonus(0.3f, Arrays.asList(new Aspect[]{Aspects.CONTROL}));
|
this.incrementTagBonus(
|
||||||
this.incrementTagBonus(0.5f, Arrays.asList(new Aspect[]{Aspect.EXCHANGE}));
|
0.3f, Arrays.asList(new Aspect[] { Aspects.CONTROL })
|
||||||
|
);
|
||||||
|
this.incrementTagBonus(
|
||||||
|
0.5f, Arrays.asList(new Aspect[] { Aspect.EXCHANGE })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (ent instanceof EntityGolem) {
|
if (ent instanceof EntityGolem) {
|
||||||
this.incrementTagBonus(0.5f, Arrays.asList(new Aspect[]{Aspect.ARMOR, Aspect.WEAPON}));
|
this.incrementTagBonus(
|
||||||
|
0.5f,
|
||||||
|
Arrays.asList(new Aspect[] { Aspect.ARMOR, Aspect.WEAPON })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (ent instanceof EntityBlaze) {
|
if (ent instanceof EntityBlaze) {
|
||||||
this.incrementTagBonus(0.3f, Arrays.asList(new Aspect[]{Aspect.FIRE}));
|
this.incrementTagBonus(
|
||||||
|
0.3f, Arrays.asList(new Aspect[] { Aspect.FIRE })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (!(ent instanceof EntityCreeper)) continue;
|
if (!(ent instanceof EntityCreeper))
|
||||||
this.incrementTagBonus(0.3f, Arrays.asList(new Aspect[]{Aspects.DESTRUCTION, Aspects.FLUX}));
|
continue;
|
||||||
}
|
this.incrementTagBonus(
|
||||||
catch (Exception e) {
|
0.3f,
|
||||||
|
Arrays.asList(new Aspect[] { Aspects.DESTRUCTION, Aspects.FLUX })
|
||||||
|
);
|
||||||
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -309,184 +422,306 @@ public class ClassicResearchTableExtension extends ResearchTableExtension implem
|
||||||
for (int x = -10; x <= 10; ++x) {
|
for (int x = -10; x <= 10; ++x) {
|
||||||
for (int z = -10; z <= 10; ++z) {
|
for (int z = -10; z <= 10; ++z) {
|
||||||
for (int y = -10; y <= 10; ++y) {
|
for (int y = -10; y <= 10; ++y) {
|
||||||
if (y + this.yCoord <= 0 || y + this.yCoord >= this.world.getActualHeight()) continue;
|
if (y + this.yCoord <= 0
|
||||||
Block bi = this.world.getBlock(x + this.xCoord, y + this.yCoord, z + this.zCoord);
|
|| y + this.yCoord >= this.world.getActualHeight())
|
||||||
int md = this.world.getBlockMetadata(x + this.xCoord, y + this.yCoord, z + this.zCoord);
|
continue;
|
||||||
|
Block bi = this.world.getBlock(
|
||||||
|
x + this.xCoord, y + this.yCoord, z + this.zCoord
|
||||||
|
);
|
||||||
|
int md = this.world.getBlockMetadata(
|
||||||
|
x + this.xCoord, y + this.yCoord, z + this.zCoord
|
||||||
|
);
|
||||||
Material bm = bi.getMaterial();
|
Material bm = bi.getMaterial();
|
||||||
if (bi == Blocks.jukebox) {
|
if (bi == Blocks.jukebox) {
|
||||||
this.incrementTagBonus(0.5f, Arrays.asList(new Aspect[]{Aspects.SOUND}));
|
this.incrementTagBonus(
|
||||||
|
0.5f, Arrays.asList(new Aspect[] { Aspects.SOUND })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.beacon) {
|
if (bi == Blocks.beacon) {
|
||||||
this.incrementTagBonus(1.0f, Arrays.asList(new Aspect[]{Aspects.CONTROL, Aspect.LIGHT}));
|
this.incrementTagBonus(
|
||||||
|
1.0f,
|
||||||
|
Arrays.asList(new Aspect[] { Aspects.CONTROL, Aspect.LIGHT })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.skull) {
|
if (bi == Blocks.skull) {
|
||||||
this.incrementTagBonus(0.5f, Arrays.asList(new Aspect[]{Aspect.MIND, Aspects.EVIL}));
|
this.incrementTagBonus(
|
||||||
|
0.5f,
|
||||||
|
Arrays.asList(new Aspect[] { Aspect.MIND, Aspects.EVIL })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.anvil) {
|
if (bi == Blocks.anvil) {
|
||||||
this.incrementTagBonus(0.5f, Arrays.asList(new Aspect[]{Aspect.CRAFT, Aspect.TOOL}));
|
this.incrementTagBonus(
|
||||||
|
0.5f,
|
||||||
|
Arrays.asList(new Aspect[] { Aspect.CRAFT, Aspect.TOOL })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.diamond_block) {
|
if (bi == Blocks.diamond_block) {
|
||||||
this.incrementTagBonus(1.0f, Arrays.asList(new Aspect[]{Aspect.CRYSTAL, Aspects.VALUABLE}));
|
this.incrementTagBonus(
|
||||||
|
1.0f,
|
||||||
|
Arrays.asList(new Aspect[] { Aspect.CRYSTAL,
|
||||||
|
Aspects.VALUABLE })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.glass_pane) {
|
if (bi == Blocks.glass_pane) {
|
||||||
this.incrementTagBonus(0.1f, Arrays.asList(new Aspect[]{Aspects.VISION}));
|
this.incrementTagBonus(
|
||||||
|
0.1f, Arrays.asList(new Aspect[] { Aspects.VISION })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.glass) {
|
if (bi == Blocks.glass) {
|
||||||
this.incrementTagBonus(0.1f, Arrays.asList(new Aspect[]{Aspect.CRYSTAL}));
|
this.incrementTagBonus(
|
||||||
|
0.1f, Arrays.asList(new Aspect[] { Aspect.CRYSTAL })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.red_flower) {
|
if (bi == Blocks.red_flower) {
|
||||||
this.incrementTagBonus(0.2f, Arrays.asList(new Aspect[]{Aspects.FLOWER}));
|
this.incrementTagBonus(
|
||||||
|
0.2f, Arrays.asList(new Aspect[] { Aspects.FLOWER })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.yellow_flower) {
|
if (bi == Blocks.yellow_flower) {
|
||||||
this.incrementTagBonus(0.2f, Arrays.asList(new Aspect[]{Aspects.FLOWER}));
|
this.incrementTagBonus(
|
||||||
|
0.2f, Arrays.asList(new Aspect[] { Aspects.FLOWER })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.log) {
|
if (bi == Blocks.log) {
|
||||||
this.incrementTagBonus(0.1f, Arrays.asList(new Aspect[]{Aspect.TREE}));
|
this.incrementTagBonus(
|
||||||
|
0.1f, Arrays.asList(new Aspect[] { Aspect.TREE })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.crafting_table) {
|
if (bi == Blocks.crafting_table) {
|
||||||
this.incrementTagBonus(0.2f, Arrays.asList(new Aspect[]{Aspect.CRAFT, Aspect.TOOL}));
|
this.incrementTagBonus(
|
||||||
|
0.2f,
|
||||||
|
Arrays.asList(new Aspect[] { Aspect.CRAFT, Aspect.TOOL })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.stone_pressure_plate || bi == Blocks.wooden_pressure_plate) {
|
if (bi == Blocks.stone_pressure_plate
|
||||||
this.incrementTagBonus(0.2f, Arrays.asList(new Aspect[]{Aspect.TRAP}));
|
|| bi == Blocks.wooden_pressure_plate) {
|
||||||
|
this.incrementTagBonus(
|
||||||
|
0.2f, Arrays.asList(new Aspect[] { Aspect.TRAP })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == ConfigBlocks.blockJar && md == 1) {
|
if (bi == ConfigBlocks.blockJar && md == 1) {
|
||||||
this.incrementTagBonus(0.5f, Arrays.asList(new Aspect[]{Aspect.MIND, Aspects.EVIL}));
|
this.incrementTagBonus(
|
||||||
|
0.5f,
|
||||||
|
Arrays.asList(new Aspect[] { Aspect.MIND, Aspects.EVIL })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == ConfigBlocks.blockJar) {
|
if (bi == ConfigBlocks.blockJar) {
|
||||||
this.incrementTagBonus(0.33f, Arrays.asList(new Aspect[]{Aspect.TRAP}));
|
this.incrementTagBonus(
|
||||||
|
0.33f, Arrays.asList(new Aspect[] { Aspect.TRAP })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.iron_block) {
|
if (bi == Blocks.iron_block) {
|
||||||
this.incrementTagBonus(0.75f, Arrays.asList(new Aspect[]{Aspect.METAL}));
|
this.incrementTagBonus(
|
||||||
|
0.75f, Arrays.asList(new Aspect[] { Aspect.METAL })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.gold_block) {
|
if (bi == Blocks.gold_block) {
|
||||||
this.incrementTagBonus(0.75f, Arrays.asList(new Aspect[]{Aspects.VALUABLE}));
|
this.incrementTagBonus(
|
||||||
|
0.75f, Arrays.asList(new Aspect[] { Aspects.VALUABLE })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.brown_mushroom_block || bi == Blocks.red_mushroom_block || bi == Blocks.brown_mushroom || bi == Blocks.red_mushroom) {
|
if (bi == Blocks.brown_mushroom_block
|
||||||
this.incrementTagBonus(0.2f, Arrays.asList(new Aspect[]{Aspects.FUNGUS}));
|
|| bi == Blocks.red_mushroom_block || bi == Blocks.brown_mushroom
|
||||||
|
|| bi == Blocks.red_mushroom) {
|
||||||
|
this.incrementTagBonus(
|
||||||
|
0.2f, Arrays.asList(new Aspect[] { Aspects.FUNGUS })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.bookshelf) {
|
if (bi == Blocks.bookshelf) {
|
||||||
this.incrementTagBonus(0.5f, Arrays.asList(new Aspect[]{Aspect.MIND}));
|
this.incrementTagBonus(
|
||||||
|
0.5f, Arrays.asList(new Aspect[] { Aspect.MIND })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.mob_spawner) {
|
if (bi == Blocks.mob_spawner) {
|
||||||
this.incrementTagBonus(1.0f, Arrays.asList(new Aspect[]{Aspect.BEAST, Aspect.CRAFT, Aspect.TRAP}));
|
this.incrementTagBonus(
|
||||||
|
1.0f,
|
||||||
|
Arrays.asList(new Aspect[] {
|
||||||
|
Aspect.BEAST, Aspect.CRAFT, Aspect.TRAP })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.chest) {
|
if (bi == Blocks.chest) {
|
||||||
this.incrementTagBonus(0.5f, Arrays.asList(new Aspect[]{Aspect.VOID}));
|
this.incrementTagBonus(
|
||||||
|
0.5f, Arrays.asList(new Aspect[] { Aspect.VOID })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.farmland) {
|
if (bi == Blocks.farmland) {
|
||||||
this.incrementTagBonus(0.2f, Arrays.asList(new Aspect[]{Aspect.CROP}));
|
this.incrementTagBonus(
|
||||||
|
0.2f, Arrays.asList(new Aspect[] { Aspect.CROP })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.end_portal_frame) {
|
if (bi == Blocks.end_portal_frame) {
|
||||||
this.incrementTagBonus(0.5f, Arrays.asList(new Aspect[]{Aspect.ELDRITCH}));
|
this.incrementTagBonus(
|
||||||
|
0.5f, Arrays.asList(new Aspect[] { Aspect.ELDRITCH })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.ender_chest) {
|
if (bi == Blocks.ender_chest) {
|
||||||
this.incrementTagBonus(1.0f, Arrays.asList(new Aspect[]{Aspect.VOID}));
|
this.incrementTagBonus(
|
||||||
|
1.0f, Arrays.asList(new Aspect[] { Aspect.VOID })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bm == Material.lava) {
|
if (bm == Material.lava) {
|
||||||
this.incrementTagBonus(0.2f, Arrays.asList(new Aspect[]{Aspect.FIRE, Aspects.ROCK}));
|
this.incrementTagBonus(
|
||||||
|
0.2f,
|
||||||
|
Arrays.asList(new Aspect[] { Aspect.FIRE, Aspects.ROCK })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bm == Material.fire) {
|
if (bm == Material.fire) {
|
||||||
this.incrementTagBonus(0.5f, Arrays.asList(new Aspect[]{Aspect.FIRE}));
|
this.incrementTagBonus(
|
||||||
|
0.5f, Arrays.asList(new Aspect[] { Aspect.FIRE })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.bedrock) {
|
if (bi == Blocks.bedrock) {
|
||||||
this.incrementTagBonus(0.1f, Arrays.asList(new Aspect[]{Aspect.DARKNESS, Aspects.ROCK, Aspect.EARTH}));
|
this.incrementTagBonus(
|
||||||
|
0.1f,
|
||||||
|
Arrays.asList(new Aspect[] {
|
||||||
|
Aspect.DARKNESS, Aspects.ROCK, Aspect.EARTH })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.deadbush) {
|
if (bi == Blocks.deadbush) {
|
||||||
this.incrementTagBonus(0.5f, Arrays.asList(new Aspect[]{Aspect.DEATH}));
|
this.incrementTagBonus(
|
||||||
|
0.5f, Arrays.asList(new Aspect[] { Aspect.DEATH })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.enchanting_table) {
|
if (bi == Blocks.enchanting_table) {
|
||||||
this.incrementTagBonus(1.0f, Arrays.asList(new Aspect[]{Aspect.MAGIC}));
|
this.incrementTagBonus(
|
||||||
|
1.0f, Arrays.asList(new Aspect[] { Aspect.MAGIC })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bm == Material.water) {
|
if (bm == Material.water) {
|
||||||
this.incrementTagBonus(0.2f, Arrays.asList(new Aspect[]{Aspect.WATER}));
|
this.incrementTagBonus(
|
||||||
|
0.2f, Arrays.asList(new Aspect[] { Aspect.WATER })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.redstone_wire) {
|
if (bi == Blocks.redstone_wire) {
|
||||||
this.incrementTagBonus(0.15f, Arrays.asList(new Aspect[]{Aspect.ENERGY, Aspect.MECHANISM}));
|
this.incrementTagBonus(
|
||||||
|
0.15f,
|
||||||
|
Arrays.asList(new Aspect[] { Aspect.ENERGY, Aspect.MECHANISM }
|
||||||
|
)
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.unpowered_repeater || bi == Blocks.powered_repeater) {
|
if (bi == Blocks.unpowered_repeater
|
||||||
this.incrementTagBonus(0.25f, Arrays.asList(new Aspect[]{Aspect.ENERGY, Aspect.MECHANISM}));
|
|| bi == Blocks.powered_repeater) {
|
||||||
|
this.incrementTagBonus(
|
||||||
|
0.25f,
|
||||||
|
Arrays.asList(new Aspect[] { Aspect.ENERGY, Aspect.MECHANISM }
|
||||||
|
)
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bm == Material.portal) {
|
if (bm == Material.portal) {
|
||||||
this.incrementTagBonus(0.5f, Arrays.asList(new Aspect[]{Aspect.ELDRITCH, Aspect.VOID}));
|
this.incrementTagBonus(
|
||||||
|
0.5f,
|
||||||
|
Arrays.asList(new Aspect[] { Aspect.ELDRITCH, Aspect.VOID })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bm == Material.cake) {
|
if (bm == Material.cake) {
|
||||||
this.incrementTagBonus(0.25f, Arrays.asList(new Aspect[]{Aspect.LIFE}));
|
this.incrementTagBonus(
|
||||||
|
0.25f, Arrays.asList(new Aspect[] { Aspect.LIFE })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bm == Material.web) {
|
if (bm == Material.web) {
|
||||||
this.incrementTagBonus(0.2f, Arrays.asList(new Aspect[]{Aspects.INSECT}));
|
this.incrementTagBonus(
|
||||||
|
0.2f, Arrays.asList(new Aspect[] { Aspects.INSECT })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bm == Material.tnt) {
|
if (bm == Material.tnt) {
|
||||||
this.incrementTagBonus(0.25f, Arrays.asList(new Aspect[]{Aspects.DESTRUCTION, Aspect.FIRE}));
|
this.incrementTagBonus(
|
||||||
|
0.25f,
|
||||||
|
Arrays.asList(new Aspect[] { Aspects.DESTRUCTION,
|
||||||
|
Aspect.FIRE })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.piston) {
|
if (bi == Blocks.piston) {
|
||||||
this.incrementTagBonus(0.3f, Arrays.asList(new Aspect[]{Aspect.MECHANISM, Aspect.MOTION}));
|
this.incrementTagBonus(
|
||||||
|
0.3f,
|
||||||
|
Arrays.asList(new Aspect[] { Aspect.MECHANISM, Aspect.MOTION }
|
||||||
|
)
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.emerald_block) {
|
if (bi == Blocks.emerald_block) {
|
||||||
this.incrementTagBonus(1.0f, Arrays.asList(new Aspect[]{Aspect.MAGIC}));
|
this.incrementTagBonus(
|
||||||
|
1.0f, Arrays.asList(new Aspect[] { Aspect.MAGIC })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bm == Material.dragonEgg) {
|
if (bm == Material.dragonEgg) {
|
||||||
this.incrementTagBonus(2.0f, Arrays.asList(new Aspect[]{Aspect.ELDRITCH, Aspects.EVIL, Aspect.MAGIC}));
|
this.incrementTagBonus(
|
||||||
|
2.0f,
|
||||||
|
Arrays.asList(new Aspect[] {
|
||||||
|
Aspect.ELDRITCH, Aspects.EVIL, Aspect.MAGIC })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bm == Material.ice) {
|
if (bm == Material.ice) {
|
||||||
this.incrementTagBonus(0.2f, Arrays.asList(new Aspect[]{Aspect.COLD}));
|
this.incrementTagBonus(
|
||||||
|
0.2f, Arrays.asList(new Aspect[] { Aspect.COLD })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bm == Material.plants) {
|
if (bm == Material.plants) {
|
||||||
this.incrementTagBonus(0.2f, Arrays.asList(new Aspect[]{Aspect.PLANT}));
|
this.incrementTagBonus(
|
||||||
|
0.2f, Arrays.asList(new Aspect[] { Aspect.PLANT })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bm == Material.redstoneLight) {
|
if (bm == Material.redstoneLight) {
|
||||||
this.incrementTagBonus(0.25f, Arrays.asList(new Aspect[]{Aspect.LIGHT}));
|
this.incrementTagBonus(
|
||||||
|
0.25f, Arrays.asList(new Aspect[] { Aspect.LIGHT })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.brewing_stand) {
|
if (bi == Blocks.brewing_stand) {
|
||||||
this.incrementTagBonus(0.5f, Arrays.asList(new Aspect[]{Aspect.MAGIC}));
|
this.incrementTagBonus(
|
||||||
|
0.5f, Arrays.asList(new Aspect[] { Aspect.MAGIC })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi == Blocks.cauldron) {
|
if (bi == Blocks.cauldron) {
|
||||||
this.incrementTagBonus(0.5f, Arrays.asList(new Aspect[]{Aspect.WATER}));
|
this.incrementTagBonus(
|
||||||
|
0.5f, Arrays.asList(new Aspect[] { Aspect.WATER })
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (bi != ConfigBlocks.blockMagicalLog || (md & 1) != 1) continue;
|
if (bi != ConfigBlocks.blockMagicalLog || (md & 1) != 1)
|
||||||
this.incrementTagBonus(0.15f, Arrays.asList(new Aspect[]{Aspects.PURE}));
|
continue;
|
||||||
|
this.incrementTagBonus(
|
||||||
|
0.15f, Arrays.asList(new Aspect[] { Aspects.PURE })
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -494,7 +729,9 @@ public class ClassicResearchTableExtension extends ResearchTableExtension implem
|
||||||
|
|
||||||
private void incrementTagBonus(float amt, List<Aspect> taglist) {
|
private void incrementTagBonus(float amt, List<Aspect> taglist) {
|
||||||
for (int a = 0; a < 5; ++a) {
|
for (int a = 0; a < 5; ++a) {
|
||||||
if (this.tags[a] == null || !taglist.contains(this.tags[a]) || !(this.tagBonus[a] + amt <= this.maxTagBonus)) continue;
|
if (this.tags[a] == null || !taglist.contains(this.tags[a])
|
||||||
|
|| !(this.tagBonus[a] + amt <= this.maxTagBonus))
|
||||||
|
continue;
|
||||||
int n = a;
|
int n = a;
|
||||||
this.tagBonus[n] = this.tagBonus[n] + amt;
|
this.tagBonus[n] = this.tagBonus[n] + amt;
|
||||||
}
|
}
|
||||||
|
@ -560,7 +797,14 @@ public class ClassicResearchTableExtension extends ResearchTableExtension implem
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isUseableByPlayer(EntityPlayer var1) {
|
public boolean isUseableByPlayer(EntityPlayer var1) {
|
||||||
return this.world.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this.getResearchTable() ? false : var1.getDistanceSq((double)this.xCoord + 0.5, (double)this.yCoord + 0.5, (double)this.zCoord + 0.5) <= 64.0;
|
return this.world.getTileEntity(this.xCoord, this.yCoord, this.zCoord)
|
||||||
|
!= this.getResearchTable()
|
||||||
|
? false
|
||||||
|
: var1.getDistanceSq(
|
||||||
|
(double) this.xCoord + 0.5,
|
||||||
|
(double) this.yCoord + 0.5,
|
||||||
|
(double) this.zCoord + 0.5
|
||||||
|
) <= 64.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -569,8 +813,7 @@ public class ClassicResearchTableExtension extends ResearchTableExtension implem
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeInventory() {
|
public void closeInventory() {}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasCustomInventoryName() {
|
public boolean hasCustomInventoryName() {
|
||||||
|
@ -581,5 +824,4 @@ public class ClassicResearchTableExtension extends ResearchTableExtension implem
|
||||||
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
|
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,8 @@ public class ResearchNoteData {
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
for (Aspect a : tags.getAspects()) {
|
for (Aspect a : tags.getAspects()) {
|
||||||
if (this.tags == null || tag != a) continue;
|
if (this.tags == null || tag != a)
|
||||||
|
continue;
|
||||||
return (float) this.progress.get(a) / (float) rr.tags.getAmount(a);
|
return (float) this.progress.get(a) / (float) rr.tags.getAmount(a);
|
||||||
}
|
}
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
|
|
Loading…
Reference in a new issue