Joseph C. Sible
80ec54eaf6
Remove unnecessary code
...
- Remove unnecessary casts
- Use the diamond operator where possible
- Remove "throws" declarations that aren't actually thrown
- Remove unused local variables
- Remove unused imports
- Remove redundant superinterfaces
2017-09-24 01:23:29 -04:00
Joseph C. Sible
9e4ae3a494
Remove some unnecessary null checks
...
We know turtle can't be null in any of these places, since in preceding code,
we called methods on it, so we would have gotten a NullPointerException then
and never gotten here if it were null.
2017-09-24 01:00:55 -04:00
Wilma456 (Jakob0815)
f20a7afa7f
Better Code
2017-09-18 15:22:44 +02:00
SquidDev
01f5d006fc
Fix BlockFaceShape not being overridden for turtles and peripherals
...
This meant one could perform various illogical actions to
non-full-blocks, such as connecting fences and placing paitings.
We also modify the behaviour of isOpaqueCube and isFullCube for
peripherals, only returning false for the case of modems and cables.
2017-09-18 08:33:40 +01:00
SquidDev
cd6b076efe
Turn on ServerComputer instances if they have timed out
2017-09-16 20:09:51 +01:00
Wilma456
5be2202b2e
Add read() to Filehandle
2017-09-16 16:06:27 +02:00
SquidDev
fbbfe33e21
Do not instantiate ServerComputer instances in the peripheral provider
...
Instead we create a ComputerProxy, which delegates methods to the
ServerComputer or TileComputerBase, depending on which one exists.
2017-09-15 18:58:13 +01:00
SquidDev
7a916ed8c2
Do not instantiate a ServerComputer for pocket computers's mount
2017-09-15 18:48:57 +01:00
SquidDev
60305cd106
Remove tile before calling destroy
...
This ensures that the tile will updating neighbouring blocks, and so
the destroyed tile will not be wrapped as a peripheral.
2017-09-15 17:40:53 +01:00
SquidDev
1ef7c8e8db
Only send the packet to people within 64 blocks
...
This is equivalent to what vanilla Minecraft does
2017-09-12 22:44:49 +01:00
SquidDev
afec3743f3
Use custom packet to play records, instead of using block events
...
Breaking a disk drive was not stopping the record being played as the
block event never reached the client. Instead, we send a custom packet
which starts/stops music at a given location.
We also remove all the plumbing for eventReceived/sendBlockEvent from
the generic block/tile classes, as they are no longer used.
Closes #443
2017-09-12 15:46:46 +01:00
SquidDev
baa8993999
Fix background and tooltips not rendering within containers
...
The methods to draw these now have to be explicitly called, hence not
showing up.
2017-09-12 15:05:32 +01:00
SquidDev
4bd5b0d236
Remove HTTPTask, queueing the event when it has finished executing
...
This means we don't have to have lots of shared state between the run
and whenFinished method, and allows for easier chaining of futures later
on.
2017-09-11 22:13:00 +01:00
Daniel Ratcliffe
6c32d8a57e
Merge pull request #394 from Wojbie/bugfix/Filesystem-dots-#35
...
Modify logic behind ... and more in file path.
2017-09-11 13:27:13 +01:00
SquidDev
5f323a85a7
Rethrow/retrigger interrupted status where appropriate
2017-09-10 22:08:08 +01:00
SquidDev
85c556d324
Rewrite the computer thread system
...
This makes a couple of significant changes to the original system, to
reduce the number of threads created and allow for multiple threads in
the future. There are several notable changes from the original
implementation:
- A blocking queue is used for the main task queue queue. This removes
the need for the "monitor" variable and allows for multiple threads
polling this queue in the future.
- The thread used to execute tasks is "cached" between tasks,
significantly reducing the number of threads which need to be
created. If a task needs to be stopped then the thread is then
terminated and a new one constructed, though this rarely happens.
2017-09-10 22:08:08 +01:00
Daniel Ratcliffe
61ff91f237
Merge pull request #316 from SquidDev-CC/feature/minecraft-1.12.2
...
Update to 1.12. Bam!
2017-09-10 20:52:26 +01:00
Wojbie
6aa4a385a3
Requested changes to logic behind ... in file path.
2017-09-10 17:51:29 +02:00
SquidDev
a2da6d9601
Pass the original block in redstone propagation
...
notifyBlockOfStateChange and notifyNeighborsOfStateExcept expect the
block which caused the redstone update, rather than the neighbor block.
Fixes #393
2017-09-10 09:32:02 +01:00
Daniel Ratcliffe
88b1124204
Merge pull request #399 from SquidDev-CC/hotfix/http-encoding
...
Fix setting an invalid content-encoding header
2017-09-10 00:28:39 +01:00
Daniel Ratcliffe
cf5216aefb
Merge pull request #401 from SquidDev-CC/hotfix/peripheral-errors
...
Fix logPeripheralErrors not being set
2017-09-10 00:06:15 +01:00
Daniel Ratcliffe
3095a6bbad
Merge pull request #241 from SquidDev-CC/feature/minecraft-1.11.2
...
Update to 1.11.2
2017-09-09 23:54:42 +01:00
Daniel Ratcliffe
fd8837c631
Merge pull request #377 from Wilma456/fserror
...
Better Errors for fs API
2017-08-27 13:51:36 +01:00
SquidDev
8f6feff4fd
Fix logPeripheralErrors not being set
2017-08-01 21:25:23 +01:00
SquidDev
26bca2e109
Fix setting an invalid content-encoding header
2017-07-31 07:50:23 +01:00
Wojbie
0d5397db34
Modify logic behind ... and more in file path.
...
Changes all equal or longer then 3 multidots setups to be treated as .
This removes other potentialy dangerus situations and brings it closer to windows in how it treats said dots.
2017-07-30 14:11:25 +02:00
Wojbie
acb5f65e16
Functional change Lignum suggested
2017-07-29 01:14:36 +02:00
Wilma456
226ae3648f
Forget string
2017-07-28 15:21:15 +02:00
Wilma456
0a5155c0ff
New style
2017-07-27 16:40:00 +02:00
SquidDev
d29ffed383
Java 8. Java 8. Does whatever Java 8 can.
...
Default methods, everywhere.
Arrow types, switch on strings.
Lambdas!
Here comes Java 8.
2017-07-25 21:10:48 +01:00
SquidDev
08099f08f2
Initial update to 1.12
...
- Convert most recipes to JSON
- Add JSON factories for impostor and turtle recipes.
- Several mappings changes
- Migrate to Forge's new registry system
2017-07-25 21:10:47 +01:00
SquidDev
bee41e7f97
Avoid deprecated warnings on ItemCable
2017-07-25 21:08:52 +01:00
SquidDev
35425f0f61
Update to 1.11.2
2017-07-25 21:08:51 +01:00
Daniel Ratcliffe
6701403370
Merge pull request #364 from KingofGamesYami/feature/computer-get-label
...
Add .getLabel
2017-07-25 20:06:22 +01:00
Daniel Ratcliffe
ff2c26c4a1
Merge pull request #367 from SquidDev-CC/feature/texture-spacing
...
Fix texture artifacts when rendering monitors
2017-07-25 20:05:31 +01:00
Daniel Ratcliffe
77cadf52fe
Merge pull request #351 from Wojbie/Fix-to-349-Monitors-causing-miscolouration-of-tile-entities
...
Fix to #349 - Monitors causing miscolouration of tile entities.
2017-07-25 19:02:43 +01:00
Daniel Ratcliffe
e97a32cd69
Merge pull request #375 from SquidDev-CC/feature/resourcepack-bios
...
Adds the ability to load custom bios.lua files from resource packs
2017-07-25 19:02:05 +01:00
SquidDev
505ccf97cf
Fix incorrect null check
...
This was causing NPEs when no headers were specified and one was
attempting to POST data.
2017-07-17 22:46:48 +01:00
Wilma456
f28a1ba517
Fix Bugs
2017-07-15 16:41:40 +02:00
Wilma456
239a2f0d25
Better Errors for fs API
2017-07-15 16:09:29 +02:00
SquidDev
c0294e1534
Adds the ability to load custom bios.lua files from resource packs
...
Computer now delegates to IComputerEnvironment which, by default, looks
in the following locations:
- Resouce pack files
- The "debug" folder
- The original ComputerCraft jar
2017-07-14 21:58:58 +01:00
SquidDev
1cf3d78eac
Fix texture artifacts when rendering monitors
...
- Adds a 1px margin around every glyph. This is generally empty,
with the exception of teletext characters where it continues their
pattern.
- Uses GL_CLAMP with the font texture.
Closes #300
2017-07-10 22:20:07 +01:00
Steven Dirth
4b36ed6719
Add .getLabel to computer peripheral
...
Closes #359
2017-07-09 12:43:50 -05:00
Wojbie
ef05eb7fe9
@SquidDev fix to #349 .
...
This fixes problem reported in #349 .
I was one of pepole that were having this bug so i was able to test it and confirm this fix.
Closes #349
2017-07-04 22:54:20 +02:00
Wilma456
6fdf38f55f
Replaced "no value" with "nil" in ArgumentHelper
2017-07-04 12:44:20 +02:00
SquidDev
6fca136327
Move Bit32 library to LuaJ sources
2017-06-28 23:05:48 +01:00
Daniel Ratcliffe
123a0158af
Merge pull request #313 from SquidDev-CC/feature/http-blacklist
...
HTTP blacklist and IP address support
2017-06-28 22:36:14 +01:00
SquidDev
b37b33f4f4
Migrate default whitelist/blacklist values to fields
...
This means we're not duplicating them between the initial field and
property creation.
2017-06-28 22:33:20 +01:00
Daniel Ratcliffe
00a1342883
Merge pull request #297 from SquidDev-CC/feature/fire-events
...
Fire Forge events where appropriate
2017-06-28 22:32:22 +01:00
SquidDev
c9a3bcb68b
Replace direct equality with InventoryUtil.areItemsEqual
...
Some IItemHandler.insertItem implementations clone the item, so we must
check whether the object is equal instead.
Fixes #340
2017-06-28 22:11:25 +01:00