Right click to update mana is gone :crabrave:

This commit is contained in:
Vincent Lee committed 2020-03-13 16:33:02 -05:00
1 parent 86bb0df996
commit ae6679d06f
17 files changed
+14 -66

No files matched your search

@@ -49,7 +49,6 @@ public class TileEntityFunctionalFlower extends TileEntitySpecialFlower {
int sizeLastCheck = -1;
TileEntity linkedPool = null;
public int knownMana = -1;
BlockPos cachedPoolCoordinates = null;
@@ -149,7 +148,6 @@ public class TileEntityFunctionalFlower extends TileEntitySpecialFlower {
if(player == null)
return false;
knownMana = mana;
SoundEvent evt = ForgeRegistries.SOUND_EVENTS.getValue(DING_SOUND_EVENT);
if(evt != null)
player.playSound(evt, 0.1F, 1F);
@@ -239,7 +237,7 @@ public class TileEntityFunctionalFlower extends TileEntitySpecialFlower {
public void renderHUD(Minecraft mc) {
String name = I18n.format(getBlockState().getBlock().getTranslationKey());
int color = getColor();
BotaniaAPI.internalHandler.drawComplexManaHUD(color, knownMana, getMaxMana(), name, BotaniaAPI.internalHandler.getBindDisplayForFlowerType(this), isValidBinding());
BotaniaAPI.internalHandler.drawComplexManaHUD(color, getMana(), getMaxMana(), name, BotaniaAPI.internalHandler.getBindDisplayForFlowerType(this), isValidBinding());
}
}
@@ -56,7 +56,6 @@ public class TileEntityGeneratingFlower extends TileEntitySpecialFlower {
int sizeLastCheck = -1;
protected TileEntity linkedCollector = null;
public int knownMana = -1;
public int passiveDecayTicks;
BlockPos cachedCollectorCoordinates = null;
@@ -204,7 +203,6 @@ public class TileEntityGeneratingFlower extends TileEntitySpecialFlower {
if(!player.world.isRemote)
sync();
knownMana = getMana();
SoundEvent evt = ForgeRegistries.SOUND_EVENTS.getValue(DING_SOUND_EVENT);
if(evt != null)
player.playSound(evt, 0.1F, 1F);
@@ -294,7 +292,7 @@ public class TileEntityGeneratingFlower extends TileEntitySpecialFlower {
public void renderHUD(Minecraft mc) {
String name = I18n.format(getBlockState().getBlock().getTranslationKey());
int color = getColor();
BotaniaAPI.internalHandler.drawComplexManaHUD(color, knownMana, getMaxMana(), name, BotaniaAPI.internalHandler.getBindDisplayForFlowerType(this), isValidBinding());
BotaniaAPI.internalHandler.drawComplexManaHUD(color, getMana(), getMaxMana(), name, BotaniaAPI.internalHandler.getBindDisplayForFlowerType(this), isValidBinding());
}
@Override
@@ -383,14 +383,7 @@ public final class HUDHandler {
x = mc.mainWindow.getScaledWidth() / 2 - 51;
y += 10;
renderManaBar(x, y, color, mana < 0 ? 0.5F : 1F, mana, maxMana);
if(mana < 0) {
String text = I18n.format("botaniamisc.statusUnknown");
x = mc.mainWindow.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(text) / 2;
y -= 1;
mc.fontRenderer.drawString(text, x, y, color);
}
renderManaBar(x, y, color, 1F, mana, maxMana);
GlStateManager.disableBlend();
}
@@ -75,7 +75,6 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt
private static final int MAX_MANA_DILLUTED = 10000;
private static final String TAG_MANA = "mana";
private static final String TAG_KNOWN_MANA = "knownMana";
private static final String TAG_OUTPUTTING = "outputting";
private static final String TAG_COLOR = "color";
private static final String TAG_MANA_CAP = "manaCap";
@@ -91,7 +90,6 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt
public DyeColor color = DyeColor.WHITE;
private int mana;
private int knownMana = -1;
public int manaCap = -1;
private int soundTicks = 0;
@@ -366,30 +364,14 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt
inputKey = cmp.getString(TAG_INPUT_KEY);
if(cmp.contains(TAG_OUTPUT_KEY))
inputKey = cmp.getString(TAG_OUTPUT_KEY);
if(cmp.contains(TAG_KNOWN_MANA))
knownMana = cmp.getInt(TAG_KNOWN_MANA);
}
public void onWanded(PlayerEntity player, ItemStack wand) {
if(player == null || player.isSneaking()) {
outputting = !outputting;
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos);
}
if(!world.isRemote) {
CompoundNBT nbttagcompound = new CompoundNBT();
writePacketNBT(nbttagcompound);
nbttagcompound.putInt(TAG_KNOWN_MANA, getCurrentMana());
if(player instanceof ServerPlayerEntity)
((ServerPlayerEntity) player).connection.sendPacket(new SUpdateTileEntityPacket(pos, -999, nbttagcompound));
}
if(player == null) {
world.playSound(null, getPos(), ModSounds.ding, SoundCategory.PLAYERS, 0.11F, 1F);
} else {
world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.ding, SoundCategory.PLAYERS, 0.11F, 1F);
}
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(world, pos);
}
@OnlyIn(Dist.CLIENT)
@@ -397,7 +379,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt
ItemStack pool = new ItemStack(getBlockState().getBlock());
String name = pool.getDisplayName().getString();
int color = 0x4444FF;
HUDHandler.drawSimpleManaHUD(color, knownMana, manaCap, name);
HUDHandler.drawSimpleManaHUD(color, getCurrentMana(), manaCap, name);
int x = Minecraft.getInstance().mainWindow.getScaledWidth() / 2 - 11;
int y = Minecraft.getInstance().mainWindow.getScaledHeight() / 2 + 30;
@@ -84,7 +84,6 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
private static final String TAG_UUID_MOST = "uuidMost";
private static final String TAG_UUID_LEAST = "uuidLeast";
private static final String TAG_MANA = "mana";
private static final String TAG_KNOWN_MANA = "knownMana";
private static final String TAG_REQUEST_UPDATE = "requestUpdate";
private static final String TAG_ROTATION_X = "rotationX";
private static final String TAG_ROTATION_Y = "rotationY";
@@ -132,7 +131,6 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
UUID identity;
private int mana;
private int knownMana = -1;
public float rotationX, rotationY;
@Nullable
@@ -341,8 +339,6 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
mmForcedGravity = cmp.getFloat(TAG_FORCED_GRAVITY);
mmForcedVelocityMultiplier = cmp.getFloat(TAG_FORCED_VELOCITY_MULTIPLIER);
if(cmp.contains(TAG_KNOWN_MANA))
knownMana = cmp.getInt(TAG_KNOWN_MANA);
if(cmp.contains(TAG_PADDING_COLOR))
paddingColor = cmp.getInt(TAG_PADDING_COLOR) == -1 ? null : DyeColor.byId(cmp.getInt(TAG_PADDING_COLOR));
if(cmp.contains(TAG_CAN_SHOOT_BURST))
@@ -384,14 +380,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
return;
if(!player.isSneaking()) {
if(!world.isRemote) {
CompoundNBT nbttagcompound = new CompoundNBT();
writePacketNBT(nbttagcompound);
nbttagcompound.putInt(TAG_KNOWN_MANA, mana);
if(player instanceof ServerPlayerEntity)
((ServerPlayerEntity) player).connection.sendPacket(new SUpdateTileEntityPacket(pos, -999, nbttagcompound));
}
world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.ding, SoundCategory.PLAYERS, 0.1F, 1);
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(this);
} else {
RayTraceResult pos = Item.rayTrace(world, player, RayTraceContext.FluidMode.ANY);
if(pos instanceof BlockRayTraceResult && !world.isRemote) {
@@ -551,7 +540,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
public void renderHUD(Minecraft mc) {
String name = new ItemStack(getBlockState().getBlock()).getDisplayName().getString();
int color = isRedstone() ? 0xFF0000 : isDreamwood() ? 0xFF00AE : 0x00FF00;
HUDHandler.drawSimpleManaHUD(color, knownMana, getMaxMana(), name);
HUDHandler.drawSimpleManaHUD(color, getCurrentMana(), getMaxMana(), name);
ItemStack lens = itemHandler.getStackInSlot(0);
if(!lens.isEmpty()) {
@@ -8,7 +8,6 @@
"itemGroup.botania": "Botania",
"botaniamisc.statusUnknown": "Unbekannter Status",
"botaniamisc.color": "%s gefärbt",
"botaniamisc.manaUsage": "Manaverbrauch",
"botaniamisc.flareColor": "Ladungen %s",
@@ -1461,4 +1460,4 @@
"botania.entry.dispenserTweaks": "Dispenser-Änderungen",
"botania.entry.shinyFlowers": "Schimmernde Blumen"
}
}
@@ -12,7 +12,6 @@
"generator.botania-skyblock": "Garden of Glass",
"generator.botania-skyblock.info": "Not recommended for Botania newcomers",
"botaniamisc.statusUnknown": "Unknown Status",
"botaniamisc.color": "%s Tinted",
"botaniamisc.manaUsage": "Mana Usage",
"botaniamisc.flareColor": "%s Rounds",
@@ -1805,7 +1804,7 @@
"botania.tagline.spreader": "Your essential Mana transporter",
"botania.page.spreader0": "The $(item)Mana Spreader$(0) is the single most important tool a botanist needs to manipulate $(thing)Mana$(0).$(p)This block shoots $(thing)Mana$(0) from point A to point B. It faces a cardinal direction when placed, but sneak-right clicking it with a $(l:basics/wand)$(item)Wand of the Forest$(0)$(/l) on a face points it elsewhere. It can be aimed at other blocks with a wand in $(thing)Bind Mode$(0).",
"botania.page.spreader1": "The $(item)Mana Spreader$(0), as seen with a $(l:basics/wand)$(item)Wand of the Forest$(0)$(/l) held",
"botania.page.spreader2": "The $(item)Mana Spreader$(0) has a small internal buffer of $(thing)Mana$(0), which will get filled by $(thing)Generating Flora$(0) bound to it. (Flowers, when placed, auto-bind to the nearest spreader.) This buffer can be viewed by right-clicking the $(item)Spreader$(0) with a $(l:basics/wand)$(item)Wand of the Forest$(0)$(/l) in hand.$(p)Note that the block needs to be right-clicked with a wand repeatedly to get a real-time view of its contents.",
"botania.page.spreader2": "The $(item)Mana Spreader$(0) has a small internal buffer of $(thing)Mana$(0), which will get filled by $(thing)Generating Flora$(0) bound to it. (Flowers, when placed, auto-bind to the nearest spreader.) This buffer can be viewed by hovering over the $(item)Spreader$(0) with a $(l:basics/wand)$(item)Wand of the Forest$(0)$(/l) in hand.",
"botania.page.spreader3": "Holding a $(l:basics/wand)$(item)Wand of the Forest$(0)$(/l) makes nearby spreaders display aiming beams. Hovering over a spreader highlights its target. The sparkles show where $(thing)Mana Loss$(0) begins to occur.$(p)As long as the target of the spreader can accept $(thing)Mana$(0) (that is, can contain $(thing)Mana$(0) and isn't full), the spreader will repeatedly fire $(thing)Mana Bursts$(0), which travel to their destination and transfer their $(thing)Mana$(0) to it.",
"botania.page.spreader4": "The spreader will only fire another burst when the last one hits its target.$(p)Furthermore, a $(thing)Mana Burst$(0) will start suffering $(thing)Mana Loss$(0) after a small amount of time: this can be seen in the burst's appearance, as it thins at that point.",
"botania.page.spreader11": "Applying a $(thing)Redstone Signal$(0) to a spreader will pause its firing of bursts. If finer control is required, a $(l:mana/redstone_spreader)$(item)Pulse Mana Spreader$(0)$(/l) is recommended, as it fires upon a redstone signal in lieu of a target.",
@@ -1984,7 +1983,7 @@
"botania.entry.fIntro": "An Introduction to Function",
"botania.tagline.fIntro": "Flowers that use mana for beneficial powers",
"botania.page.fIntro0": "There are myriad uses for the $(thing)Mana$(0) a botanist generates, notably as the fuel for an assortment of $(thing)Functional Flora$(0).$(p)These flowers will drain $(thing)Mana$(0) from a nearby $(l:mana/pool)$(item)Mana Pool$(0)$(/l) into themselves to perform their respective functions.$(p)Note that flowers can't receive power directly through $(l:mana/spreader)$(item)Mana Spreaders$(0)$(/l).",
"botania.page.fIntro1": "All $(thing)Functional Flora$(0), just like $(thing)Generating Flora$(0), contain a small buffer of $(thing)Mana$(0).$(p)Standard rules for $(thing)Mana$(0)-reading apply (right-clicking with a $(l:basics/wand)$(item)Wand of the Forest$(0)$(/l) will update your view of its buffer).",
"botania.page.fIntro1": "All $(thing)Functional Flora$(0), just like $(thing)Generating Flora$(0), contain a small buffer of $(thing)Mana$(0).",
"botania.page.fIntro2": "Flowers bind to only one $(l:mana/pool)$(item)Mana Pool$(0)$(/l) at a time. When placed, they'll bind to the nearest pool (or the closest placed afterward, if none were in range), and should be re-bound with a wand in $(thing)Bind Mode$(0).",
"botania.page.fIntro3": "Additionally, some functional flowers use a $(item)Redstone Root$(0) in their creation. These flowers' effects can be toggled with redstone signals.",
"botania.page.fIntro4": "$(item)Redstone Root$(0) for Redstone Control",
@@ -2140,7 +2139,7 @@
"botania.entry.gIntro": "An Introduction to Generation",
"botania.tagline.gIntro": "Flowers that consume resources to make mana",
"botania.page.gIntro0": "Generating $(thing)Mana$(0) should be at the top of any botanist's priority list. Luckily, there's a wide selection of $(thing)Generating Flora$(0) willing to do the job.$(p)These flowers, as the name would imply, generate $(thing)Mana$(0), usually consuming resources to do so.",
"botania.page.gIntro1": "All $(thing)Generating Flora$(0), like their $(thing)Functional$(0) brethren, can hold a small internal buffer of $(thing)Mana$(0).$(p)Standard rules for $(thing)Mana$(0) reading apply (right-clicking with a $(l:basics/wand)$(item)Wand of the Forest$(0)$(/l) will update your view of its buffer).$(p)$(thing)Generating Flora$(0) will automatically output to the closest nearby $(l:mana/spreader)$(item)Mana Spreader$(0)$(/l).",
"botania.page.gIntro1": "All $(thing)Generating Flora$(0), like their $(thing)Functional$(0) brethren, can hold a small internal buffer of $(thing)Mana$(0).$(p)$(thing)Generating Flora$(0) will automatically output to the closest nearby $(l:mana/spreader)$(item)Mana Spreader$(0)$(/l).",
"botania.page.gIntro2": "These flowers bind to one $(l:mana/spreader)$(item)Mana Spreader$(0)$(/l) at a time for $(thing)Mana$(0) output. They'll bind to the nearest spreader present at the time of their placement (or the nearest placed afterward, if none were in range), and must be re-bound to another spreader with a wand in $(thing)Bind Mode$(0), if so desired.",
"botania.page.gIntro3": "Choosing your first $(thing)Generating Flower$(0) is a pretty simple task; the simplest two choices for any fledgling botanist are the $(l:generating_flowers/endoflame)$(item)Endoflame$(0)$(/l) and the $(l:generating_flowers/hydroangeas)$(item)Hydroangeas$(0)$(/l).$(p)The former uses $(item)Coal$(0) or other fuel sources to generate $(thing)Mana$(0). The latter uses $(item)Water$(0) sources for the same task, but decays after about three days.",
@@ -7,7 +7,6 @@
"_comment5": "Once again, don't copy from English, and THANK YOU for your hard work!",
"itemGroup.botania": "Botania",
"botaniamisc.statusUnknown": "Estado Desconocido",
"botaniamisc.color": "%s Teñido",
"botaniamisc.manaUsage": "Uso de Maná",
"botaniamisc.flareColor": "%s Rounds",
@@ -166,4 +165,4 @@
"block.botania.manasteel_block": "Bloque de Acero de Maná",
"block.botania.terrasteel_block": "Bloque de Acero de la Tierra",
"block.botania.elementium_block": "Bloque de Elementium"
}
}
@@ -11,7 +11,6 @@
"generator.botania-skyblock": "Jardín de cristal",
"generator.botania-skyblock.info": "No recomendado para neófitos en Botania",
"botaniamisc.statusUnknown": "Estado desconocido",
"botaniamisc.color": "Teñido a %s",
"botaniamisc.manaUsage": "Uso de maná",
"botaniamisc.flareColor": "%s rondas",
@@ -10,7 +10,6 @@
"generator.botania-skyblock": "Jardin de verre",
"generator.botania-skyblock.info": "Non recommandé pour les débutants de botania",
"botaniamisc.statusUnknown": "Statut inconnu",
"botaniamisc.color": "%s teinté",
"botaniamisc.manaUsage": "Utilisation de mana",
"botaniamisc.flareColor": "%s tours",
@@ -1166,4 +1165,4 @@
"botania.entry.fireRod": "Bâton des enfers",
"botania.entry.skyDirtRod": "Bâton des hautes-terres"
}
}
@@ -10,7 +10,6 @@
"generator.botania-skyblock": "ガーデンオブグラス",
"generator.botania-skyblock.info": "初心者には非推奨",
"botaniamisc.statusUnknown": "不明な状態",
"botaniamisc.color": "%s に染められている",
"botaniamisc.manaUsage": "マナ使用量",
"botaniamisc.outputtingPower": "アイテムへマナを送る",
@@ -11,7 +11,6 @@
"generator.botania-skyblock": "잔디의 정원",
"generator.botania-skyblock.info": "보타니아를 처음하는 분에게는 권장하지 않습니다.",
"botaniamisc.statusUnknown": "알 수 없는 상태",
"botaniamisc.color": "%s 색",
"botaniamisc.manaUsage": "마나 사용량",
"botaniamisc.flareColor": "%s 색",
@@ -1513,4 +1512,4 @@
"botania.page.runeAltar17": "$(item)격노의 룬$(0) 제작하기",
"botania.page.runeAltar18": "$(item)질투의 룬$(0) 제작하기",
"botania.page.runeAltar19": "$(item)교만의 룬$(0) 제작하기"
}
}
@@ -11,7 +11,6 @@
"generator.botania-skyblock.info": "Niet aanbevolen voor Botania beginners",
"botaniamisc.craftingContainer": "Opbrengst van de productie",
"botaniamisc.statusUnknown": "Onbekende Status",
"botaniamisc.color": "%s Gekleurd",
"botaniamisc.manaUsage": "Mana Verbruik",
"botaniamisc.flareColor": "%s Ladingen",
@@ -10,7 +10,6 @@
"generator.botania-skyblock": "Jardim de Vidro",
"generator.botania-skyblock.info": "Não recomendado para iniciantes",
"botaniamisc.craftingContainer": "Cria",
"botaniamisc.statusUnknown": "Status desconhecido",
"botaniamisc.color": "Cor: %s",
"botaniamisc.manaUsage": "Uso de Mana",
"botaniamisc.flareColor": "Projéteis: %s",
@@ -13,7 +13,6 @@
"generator.botania-skyblock.info": "Не рекомендуется для новичков",
"botaniamisc.craftingContainer": "Вернуться к созданию",
"botaniamisc.statusUnknown": "Неизвестный статус",
"botaniamisc.color": "Окрашено в %s",
"botaniamisc.manaUsage": "Потребление маны",
"botaniamisc.flareColor": "%s салют",
@@ -14,7 +14,6 @@
"botaniamisc.craftingContainer": "合成返还",
"botaniamisc.statusUnknown": "未知状态",
"botaniamisc.color": "%s 染色",
"botaniamisc.manaUsage": "魔力消耗",
"botaniamisc.flareColor": "%s 弹药",
@@ -11,7 +11,6 @@
"generator.botania-skyblock.info": "不建議植物魔法新手使用",
"botaniamisc.craftingContainer": "合成返還",
"botaniamisc.statusUnknown": "未知狀態",
"botaniamisc.color": "%s 染色",
"botaniamisc.manaUsage": "瑪那消耗",
"botaniamisc.flareColor": "%s 彈藥",