aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorchill <chill.gtnh@outlook.com>2023-05-07 16:14:51 +0200
committerGitHub <noreply@github.com>2023-05-07 16:14:51 +0200
commitdf2fb5c5cc0f2cf60439feac8100ed5990f4bcbc (patch)
tree33fce5b906c02dc5dbab9909c08d4978fcc63f22 /src
parent5df658c52ae4d831339d884413c043326c45d4fc (diff)
downloadGT5-Unofficial-df2fb5c5cc0f2cf60439feac8100ed5990f4bcbc.tar.gz
GT5-Unofficial-df2fb5c5cc0f2cf60439feac8100ed5990f4bcbc.tar.bz2
GT5-Unofficial-df2fb5c5cc0f2cf60439feac8100ed5990f4bcbc.zip
Add docs to mute (#1960)
* XSTR: fix typo * XSTR: remove commented-out code * MultiTileEntity: explain hatches and reword comments * Move the note on hatches from MTE to Controller * Remove wrongly-located javadoc * XSTR: reword to be easier understood
Diffstat (limited to 'src')
-rw-r--r--src/main/java/gregtech/api/multitileentity/base/MultiTileEntity.java12
-rw-r--r--src/main/java/gregtech/api/multitileentity/multiblock/base/Controller.java3
-rw-r--r--src/main/java/gregtech/api/objects/XSTR.java17
3 files changed, 13 insertions, 19 deletions
diff --git a/src/main/java/gregtech/api/multitileentity/base/MultiTileEntity.java b/src/main/java/gregtech/api/multitileentity/base/MultiTileEntity.java
index 9427b4d2b5..af4ef30699 100644
--- a/src/main/java/gregtech/api/multitileentity/base/MultiTileEntity.java
+++ b/src/main/java/gregtech/api/multitileentity/base/MultiTileEntity.java
@@ -72,14 +72,14 @@ public abstract class MultiTileEntity extends CoverableTileEntity
private ITexture backOverlayTexture = null;
private ITexture frontOverlayTexture = null;
- // Makes a Bounding Box without having to constantly specify the Offset Coordinates.
+ // A Bounding Box without having to constantly specify the Offset Coordinates.
protected static final float[] PX_BOX = { 0, 0, 0, 1, 1, 1 };
public Materials material = Materials._NULL;
protected final boolean isTicking; // If this TileEntity is ticking at all
- // This Variable checks if this TileEntity should refresh when the Block is being set. That way you
- // can turn this check off any time you need it.
+ // Checks if this TileEntity should refresh when the Block is being set.
+ // This way you can toggle this check at any time.
protected boolean shouldRefresh = true;
protected boolean needsBlockUpdate = false; // This Variable is for a buffered Block Update.
@@ -207,12 +207,12 @@ public abstract class MultiTileEntity extends CoverableTileEntity
@Override
public void readFromNBT(NBTTagCompound nbt) {
- // Check if this is a World/Chunk Loading Process calling readFromNBT.
+ // Check if it is a World/Chunk-Loading Process calling readFromNBT
if (mteID == GT_Values.W || mteRegistry == GT_Values.W) {
- // Yes it is, so read the ID Tags first.
+ // Read the ID Tags first
mteID = nbt.getShort(NBT.MTE_ID);
mteRegistry = nbt.getShort(NBT.MTE_REG);
- // And add additional Default Parameters, in case the Mod updated with new ones.
+ // Add additional Default Parameters in case the Mod updated with new ones
final MultiTileEntityRegistry tRegistry = MultiTileEntityRegistry.getRegistry(mteRegistry);
if (tRegistry != null) {
final MultiTileEntityClassContainer tClass = tRegistry.getClassContainer(mteID);
diff --git a/src/main/java/gregtech/api/multitileentity/multiblock/base/Controller.java b/src/main/java/gregtech/api/multitileentity/multiblock/base/Controller.java
index 659e53e428..c1314ec992 100644
--- a/src/main/java/gregtech/api/multitileentity/multiblock/base/Controller.java
+++ b/src/main/java/gregtech/api/multitileentity/multiblock/base/Controller.java
@@ -102,6 +102,9 @@ import gregtech.common.tileentities.casings.upgrade.Inventory;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
+/**
+ * Multi Tile Entities - or MuTEs - don't have dedicated hatches, but their casings can become hatches.
+ */
public abstract class Controller<T extends Controller<T>> extends MultiTileBasicMachine implements IAlignment,
IConstructable, IMultiBlockController, IDescribable, IMTE_AddToolTips, ISurvivalConstructable {
diff --git a/src/main/java/gregtech/api/objects/XSTR.java b/src/main/java/gregtech/api/objects/XSTR.java
index 3a71e9afab..1ce5273e7e 100644
--- a/src/main/java/gregtech/api/objects/XSTR.java
+++ b/src/main/java/gregtech/api/objects/XSTR.java
@@ -164,7 +164,7 @@ public class XSTR extends Random {
* one {@code int} value in the specified range is pseudorandomly generated and returned. All {@code bound} possible
* {@code int} values are produced with (approximately) equal probability. The method {@code nextInt(int bound)} is
* implemented by class {@code Random} as if by:
- *
+ *
* <pre>
* {@code
* public int nextInt(int bound) {
@@ -184,9 +184,9 @@ public class XSTR extends Random {
* </pre>
*
* <p>
- * The hedge "approx imately" is used in the foregoing description only because the next method is only
- * approximately an unbiased source of independently chosen bits. If it were a perfect source of randomly chosen
- * bits, then the algorithm shown would choose {@code int} values from the stated range with perfect uniformity.
+ * The next method is only approximately an unbiased source of independently chosen bits. If it were a perfect
+ * source of randomly chosen bits, then the algorithm shown would choose {@code int} values from the stated range
+ * with perfect uniformity.
* <p>
* The algorithm is slightly tricky. It rejects values that would result in an uneven distribution (due to the fact
* that 2^31 is not divisible by n). The probability of a value being rejected depends on n. The worst case is
@@ -208,15 +208,6 @@ public class XSTR extends Random {
*/
@Override
public int nextInt(int bound) {
- // if (bound <= 0) {
- // throw new RuntimeException("BadBound");
- // }
-
- /*
- * int r = next(31); int m = bound - 1; if ((bound & m) == 0) // i.e., bound is a power of 2 { r = (int) ((bound
- * * (long) r) >> 31); } else { for (int u = r; u - (r = u % bound) + m < 0; u = next(31)) ; } return r;
- */
- // speedup, new nextInt ~+40%
last = seed ^ (seed << 21);
last ^= (last >>> 35);
last ^= (last << 4);