1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-30 17:13:20 +00:00
Commit Graph

191 Commits

Author SHA1 Message Date
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
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
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
SquidDev
eb628e9b62 Make error messages more consistent 2017-06-13 19:33:42 +01:00
SquidDev
585c769c2a Restructure the HTTP API
- Adds support for blacklisting domains
 - Adds support for blacklisting & whitelisting IP addresses and
   IP ranges.
 - Reuse threads for HTTP requests

AddressPredicate will parse a series of patterns and convert them into
regexes or CIDR ranges. When checking whether an address is accessible,
we first ensure the domain is whitelisted and isn't blacklisted.

If everything is OK, then we start create a new thread for the HTTP
request and resolve the IP, ensuring that is whitelisted & not
blacklisted. Then the normal HTTP request is continued.

However, http.checkURL also needs to resolve the IP address. In order to
avoid blocking the Lua thread, this method will return instantly and
create a new thread which will queue an event.

As both http.request and http.checkURL are now creating threads and
queuing events, some logic is abstracted into a separate HTTPTask class
- this allows us to share the thread creation, finishing and cancelling
logic.
2017-06-12 19:22:02 +01:00
SquidDev
bffc3c18cc Rewrite argument validation
This uses a new utility class ArgumentHelper, which provides convenience
methods for parsing arguments from an array of Objects.

The format of error messages has also changed. It now follows a format
similar to Lua's native error messages - including the invalid argument
index, the expected type and the type actually received.
2017-06-12 10:28:31 +01:00
SquidDev
255dc925fb Fire Forge events where appropriate
- BlockEvent.BreakEvent and BlockEvent.HarvestDropsEvent are fired when
   digging.
 - AttackEntityEvent is fired when attacking.
 - Various PlayerInteractEvent.* events are fired when placing.

Closes #103, closes #100
2017-05-31 12:41:31 +01:00
Lignum
44c67796b8
Fix generic-related compiler warning 2017-05-29 17:35:41 +02:00
Wojbie
47f470910e Fix to getPalletteColour
Done as @dan200 specified in #287. Closes #287.
2017-05-28 14:08:15 +02:00
Lignum
0a2cb7442d
Merge branch 'master' into fix-speakers 2017-05-20 13:23:12 +02:00
Daniel Ratcliffe
d86aa50bec Merge pull request #267 from SquidDev-CC/feature/tutle-tool-changes
Shovel upgrade converts grass to path blocks
2017-05-20 12:16:47 +01:00
Lignum
163c1db6be
Fix some if statements 2017-05-19 23:37:02 +02:00
Lignum
c2af482615
Format TileSpeaker and TurtleSpeaker 2017-05-19 20:25:08 +02:00
Lignum
a402fc9093
Format SpeakerPeripheral correctly 2017-05-19 20:20:51 +02:00
SquidDev
971c719a9f Add some sanity checks to Palette.readFromNBT
Printers use a Terminal to store the page currently being printed.
Printers saved in an older version of ComputerCraft would be missing the
term_palette field, resulting in an NPE when loading the tile.
2017-05-19 11:47:27 +01:00
Daniel Ratcliffe
f3c291cb4d Merge pull request #205 from SquidDev-CC/feature/packet-network-api
Expose wireless network in the public API
2017-05-18 23:57:44 +01:00
SquidDev
d76ce22db7 Split transmit into two separate methods
This removes the interdimensional and range options from the packet
and ensures they are provides them from the transmit* methods instead.
2017-05-18 23:50:14 +01:00
Wojbie
af07a78f76 Speaker rage limit
Limit max volume of speaker to volume of normal noteblock.
2017-05-18 23:12:55 +02:00
SquidDev
5cf581e6c9 Fix files not writing data when closed
As the raw stream was being provided to the parent class, buffered data
was not written, resulting in empty files. This ensures the buffered
reader/writer is the one which is closed.
2017-05-17 19:25:13 +01:00
SquidDev
12e61efd76 Fixes speakers playing incorrect sounds on the server
As a new SoundEvent was being created each time, the actual sound was
not in the registry, resulting in the sound -> id mapping yielding
incorrect values.
2017-05-17 08:00:14 +01:00
SquidDev
b5e75a86c8 Remove AT for Block.createStackedBlock
Access transformers do not propagate to sub classes, and so the access
transformer did not work here. Reverting to reflection fixes this issue.
2017-05-16 21:19:36 +01:00
Daniel Ratcliffe
ba4b1e21fe Merge pull request #238 from SquidDev-CC/feature/binary-handles
Refactor the filesystem and HTTP code
2017-05-16 20:02:34 +01:00
Daniel Ratcliffe
cd85a03429 Merge pull request #237 from Restioson/feature/speaker
[Peripheral] Speaker
2017-05-16 19:52:10 +01:00
Daniel Ratcliffe
2e22ca4ccf Merge pull request #217 from SquidDev-CC/feature/logging
Add a basic logging system
2017-05-16 19:38:03 +01:00
SquidDev
0e1135ed97 Disable peripheral logging by default 2017-05-16 19:35:07 +01:00
Daniel Ratcliffe
ebbdd29bd6 Merge pull request #243 from SquidDev-CC/feature/access-transformer
Replace reflection with access transformers
2017-05-16 19:25:10 +01:00
Restioson
4df4b91d09 Converted (!x == y) to x != y 2017-05-16 20:02:59 +02:00
Restioson
b28c565665 (Hopefully) addressed @dan200's concerns
Push your fix to thread safety if this doesn't cut it
2017-05-16 19:48:38 +02:00
SquidDev
efb0065ebd Add config option to disable certain error messages 2017-05-16 15:59:09 +01:00
SquidDev
a0b6cbb671 Remove ILogger facade
Just use global Log4j logger on the ComputerCraft class.
2017-05-16 15:49:55 +01:00
SquidDev
44ba4069c1 Print stack traces/add logging messages in several places
This will hopefully make it easier to track down various issues which
might otherwise go unnoticed or provide little information.

The main areas modified are those that external APIs may provide values
for or interact with: various providers and ILuaObject/IPeripheral
implementations. However, we do also log in a couple of other places
which indicate a problem with this, or another, mod.
2017-05-16 15:49:55 +01:00
SquidDev
bdc438fc62 Add a basic logging system
This adds a common ILogger interface and two built-in loggers - one
which prints to stdout, the other using a Log4J logger. These are split
up as not to cause dependency issues for emulators.

The stdout logger is enabled by default, but the ComputerCraft mod class
will swap over to using FML's mod specific logger, which provides a more
consistent look with the rest of Minecraft.
2017-05-16 15:49:55 +01:00
Restioson
b3c49db761 Made Speaker threadsafe & fix warnings 2017-05-15 17:42:29 +02:00
Restioson
7ff4631a9f @gegy1000 strikes again 2017-05-15 17:42:29 +02:00
Restioson
aad81bead7 Fix style
@gegy1000 don't say *I* get distracted
2017-05-15 17:42:29 +02:00
Restioson
88b55934c7 Fix castException 2017-05-15 17:42:29 +02:00